Skip to content

Commit 1138d1d

Browse files
committed
chore: use testing-library dom events
1 parent d6659bf commit 1138d1d

3 files changed

Lines changed: 18 additions & 15 deletions

File tree

package.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,33 @@
5353
"clsx": "^2.1.1"
5454
},
5555
"devDependencies": {
56+
"@babel/eslint-parser": "^7.29.7",
57+
"@babel/eslint-plugin": "^7.29.7",
58+
"@eslint/eslintrc": "^3.3.5",
59+
"@eslint/js": "^9.39.4",
5660
"@rc-component/drawer": "^1.0.0",
5761
"@rc-component/father-plugin": "^2.2.0",
5862
"@rc-component/np": "^1.0.4",
5963
"@rc-component/select": "^1.0.0",
64+
"@testing-library/dom": "^10.4.1",
6065
"@testing-library/jest-dom": "^6.9.1",
6166
"@testing-library/react": "^16.3.2",
6267
"@types/jest": "^30.0.0",
6368
"@types/keyv": "^4.2.0",
6469
"@types/node": "^26.0.1",
6570
"@types/react": "^19.2.17",
6671
"@types/react-dom": "^19.2.3",
72+
"@typescript-eslint/eslint-plugin": "^8.62.0",
73+
"@typescript-eslint/parser": "^8.62.0",
6774
"@umijs/fabric": "^4.0.1",
6875
"bootstrap": "^5.3.7",
6976
"dumi": "^2.4.35",
7077
"eslint": "^9.39.4",
78+
"eslint-config-prettier": "^10.1.8",
79+
"eslint-plugin-jest": "^29.15.3",
80+
"eslint-plugin-react": "^7.37.5",
81+
"eslint-plugin-react-hooks": "^7.1.1",
82+
"eslint-plugin-unicorn": "^65.0.1",
7183
"father": "^4.6.23",
7284
"gh-pages": "^6.3.0",
7385
"glob": "^13.0.6",
@@ -79,18 +91,7 @@
7991
"react": "^19.2.7",
8092
"react-dom": "^19.2.7",
8193
"react-draggable": "^4.4.3",
82-
"typescript": "^6.0.3",
83-
"@eslint/eslintrc": "^3.3.5",
84-
"@eslint/js": "^9.39.4",
85-
"eslint-plugin-react": "^7.37.5",
86-
"eslint-plugin-react-hooks": "^7.1.1",
87-
"eslint-config-prettier": "^10.1.8",
88-
"@babel/eslint-parser": "^7.29.7",
89-
"@babel/eslint-plugin": "^7.29.7",
90-
"@typescript-eslint/eslint-plugin": "^8.62.0",
91-
"@typescript-eslint/parser": "^8.62.0",
92-
"eslint-plugin-jest": "^29.15.3",
93-
"eslint-plugin-unicorn": "^65.0.1"
94+
"typescript": "^6.0.3"
9495
},
9596
"peerDependencies": {
9697
"react": ">=18.0.0",

tests/index.spec.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import { fireEvent } from '@testing-library/dom';
12
/* eslint-disable react/no-render-return-value, max-classes-per-file, func-names, no-console */
2-
import { fireEvent, render, act } from '@testing-library/react';
3+
import { render, act } from '@testing-library/react';
34
import { Provider } from '@rc-component/motion';
45
import React, { cloneElement, useEffect } from 'react';
56
import type { DialogProps } from '../src';
@@ -193,7 +194,7 @@ describe('dialog', () => {
193194
const { getByText } = render(
194195
<Dialog visible maskClosable onClose={onClose}>
195196
Content
196-
</Dialog>
197+
</Dialog>,
197198
);
198199

199200
jest.runAllTimers();

tests/portal.spec.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import { fireEvent } from '@testing-library/dom';
12
/* eslint-disable react/no-render-return-value, max-classes-per-file, func-names, no-console */
23
import React from 'react';
34
import Select from '@rc-component/select';
4-
import { render, fireEvent } from '@testing-library/react';
5+
import { render } from '@testing-library/react';
56
import Dialog from '../src';
67

78
/**

0 commit comments

Comments
 (0)