Skip to content

Commit c92154c

Browse files
committed
Update test case. Replace enzyme test code with @testing-library/react.
Update test cases in `tests/index.spec.tsx` to use `@testing-library/react` instead of `enzyme`. * Replace `enzyme` imports with `@testing-library/react` imports. * Update test cases to use `render`, `fireEvent`, and other utilities from `@testing-library/react`. * Remove `mount` and `ReactWrapper` imports. * Change code `props.style` with `toHaveStyle({ key: value })` style. * Change `style.display` check to be `toHaveStyle("display: block")` or `display: none`. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/react-component/dialog?shareId=XXXX-XXXX-XXXX-XXXX).
1 parent 7b7a302 commit c92154c

File tree

5 files changed

+158
-224
lines changed

5 files changed

+158
-224
lines changed

jest.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
module.exports = {
22
setupFiles: ["./tests/setup.js"],
33
setupFilesAfterEnv: ["./tests/setupFilesAfterEnv.ts"],
4-
snapshotSerializers: [require.resolve("enzyme-to-json/serializer")],
54
};

package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
"@rc-component/father-plugin": "^2.0.1",
6060
"@testing-library/jest-dom": "^6.1.6",
6161
"@testing-library/react": "^12.0.0",
62-
"@types/enzyme": "^3.10.7",
6362
"@types/jest": "^29.4.0",
6463
"@types/keyv": "3.1.4",
6564
"@types/react": "^18.0.24",
@@ -69,9 +68,6 @@
6968
"cheerio": "1.0.0-rc.12",
7069
"cross-env": "^7.0.0",
7170
"dumi": "^2.1.3",
72-
"enzyme": "^3.1.1",
73-
"enzyme-adapter-react-16": "^1.0.1",
74-
"enzyme-to-json": "^3.1.2",
7571
"eslint": "^7.1.0",
7672
"eslint-config-airbnb": "^19.0.4",
7773
"eslint-plugin-react": "^7.20.6",

0 commit comments

Comments
 (0)