Commit ffa313a
authored
test: replace enzyme test code with @testing-library/react. (#471)
* 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).
* test: fix part
* test: fix lint
* test: fix test case
* chore: adjust package.json1 parent 7b7a302 commit ffa313a
File tree
5 files changed
+220
-238
lines changed- tests
5 files changed
+220
-238
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
| 61 | + | |
63 | 62 | | |
64 | 63 | | |
65 | 64 | | |
| |||
69 | 68 | | |
70 | 69 | | |
71 | 70 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | 71 | | |
76 | 72 | | |
77 | 73 | | |
| |||
86 | 82 | | |
87 | 83 | | |
88 | 84 | | |
89 | | - | |
90 | | - | |
| 85 | + | |
| 86 | + | |
91 | 87 | | |
92 | 88 | | |
93 | 89 | | |
94 | 90 | | |
95 | | - | |
96 | | - | |
| 91 | + | |
| 92 | + | |
97 | 93 | | |
98 | 94 | | |
0 commit comments