Skip to content

Commit 0b23f29

Browse files
committed
refactor(tests): update test files to use Vitest for improved testing consistency
- Added Vitest imports to various test files for better test management. - Updated snapshot tests to reflect changes in component rendering. - Adjusted TypeScript configuration to include additional test and source file paths. - Removed outdated snapshot data and unnecessary test cases to streamline testing.
1 parent 032765b commit 0b23f29

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+146
-2170
lines changed

tests/card/checkcard.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { CheckCard } from '@ant-design/pro-components';
22
import { cleanup, render, waitFor } from '@testing-library/react';
33
import { act } from 'react';
4+
import { afterEach, describe, expect, it, vi } from 'vitest';
45

56
afterEach(() => {
67
cleanup();

tests/card/index.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ProCard } from '@ant-design/pro-components';
22
import { cleanup, render, waitFor } from '@testing-library/react';
33
import { act } from 'react';
4+
import { afterEach, describe, expect, it, vi } from 'vitest';
45

56
vi.mock('antd/lib/grid/hooks/useBreakpoint');
67

tests/descriptions/editor.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { cleanup, fireEvent, render, waitFor } from '@testing-library/react';
88
import { Form, InputNumber } from 'antd';
99
import useMergedState from 'rc-util/lib/hooks/useMergedState';
1010
import React, { act, useRef } from 'react';
11+
import { afterEach, describe, expect, it, vi } from 'vitest';
1112
type DataSourceType = {
1213
id: number;
1314
title?: string;

tests/descriptions/index.test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import type { ProCoreActionType } from '@ant-design/pro-utils';
33
import { cleanup, render, waitFor } from '@testing-library/react';
44
import { Button, Input } from 'antd';
55
import React, { act } from 'react';
6+
import { afterEach, describe, expect, it, vi } from 'vitest';
7+
68
afterEach(() => {
79
cleanup();
810
});

tests/field/field.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import userEvent from '@testing-library/user-event';
1010
import { Button, Input } from 'antd';
1111
import dayjs from 'dayjs';
1212
import React, { act, useState } from 'react';
13+
import { afterEach, describe, expect, it, vi } from 'vitest';
1314
import { waitForWaitTime, waitTime } from '../util';
1415
import Demo from './fixtures/demo';
1516
import { TreeSelectDemo } from './fixtures/treeSelectDemo';

0 commit comments

Comments
 (0)