Skip to content

Commit

Permalink
feat: 在测试环境中更新Markdown编辑器节点列表逻辑,调整测试延迟时间
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed Jan 16, 2025
1 parent 5f479c9 commit a12f675
Show file tree
Hide file tree
Showing 5 changed files with 1,191 additions and 26 deletions.
7 changes: 6 additions & 1 deletion src/MarkdownEditor/demos/bug.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3502,6 +3502,12 @@ const Rerender = () => {
const instance = useRef<MarkdownEditorInstance>();
useEffect(() => {
const run = async () => {
if (process.env.NODE_ENV === 'test') {
instance.current?.store.updateNodeList(
parserMarkdown(mdList.at(-1)?.data?.content||'').schema,
);
return;
}
mdList?.forEach((item, index) => {
setTimeout(() => {
instance.current?.store.updateNodeList(
Expand Down Expand Up @@ -3606,7 +3612,6 @@ export default () => {
);
})}
<Rerender />

<MarkdownEditor
initValue={bugMd}
toc={false}
Expand Down
Loading

1 comment on commit a12f675

@vercel
Copy link

@vercel vercel bot commented on a12f675 Jan 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.