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 a12f675 commit 8adce1a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/demo/__snapshots__/src/MarkdownEditor/demos/min.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5663,14 +5663,14 @@
class="ant-anchor"
>
<span
class="ant-anchor-ink"
class="ant-anchor-ink ant-anchor-ink-visible"
style="top: 0px; height: 0px;"
/>
<div
class="ant-anchor-link"
class="ant-anchor-link ant-anchor-link-active"
>
<a
class="ant-anchor-link-title"
class="ant-anchor-link-title ant-anchor-link-title-active"
href="#图片"
title="图片"
>
Expand Down Expand Up @@ -5823,14 +5823,14 @@
class="ant-anchor"
>
<span
class="ant-anchor-ink"
class="ant-anchor-ink ant-anchor-ink-visible"
style="top: 0px; height: 0px;"
/>
<div
class="ant-anchor-link"
class="ant-anchor-link ant-anchor-link-active"
>
<a
class="ant-anchor-link-title"
class="ant-anchor-link-title ant-anchor-link-title-active"
href="#视频"
title="视频"
>
Expand Down
8 changes: 8 additions & 0 deletions tests/demo/demo.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import { glob } from 'glob';
import React, { useEffect } from 'react';
import { afterEach, beforeAll, describe, expect, it, vi } from 'vitest';

const waitTime = (time: number) =>
new Promise((resolve) => {
setTimeout(resolve, time);
});

const TestApp = (props: { children: any; onInit: () => void }) => {
useEffect(() => {
setTimeout(() => {
Expand Down Expand Up @@ -35,6 +40,7 @@ function demoTest() {
it(`renders ${file} correctly`, async () => {
const fn = vi.fn();
Math.random = () => 0.8404419276253765;

const DemoModule = await import(file);
const wrapper = render(
<ConfigProvider
Expand All @@ -47,6 +53,8 @@ function demoTest() {
</TestApp>
</ConfigProvider>,
);

await waitTime(1000);
await waitFor(() => {
return wrapper.findAllByText('test');
});
Expand Down

1 comment on commit 8adce1a

@vercel
Copy link

@vercel vercel bot commented on 8adce1a 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.