Commit 4bf8ae5
committed
Fix useExtraContentPadding tests by removing jest.resetModules and dynamic require
jest.resetModules() was causing React to be reloaded, creating multiple React
instances and violating the Rules of Hooks. The tests used top-level
jest.mock() which doesn't require module resetting between tests - the mock is
already applied globally. The dynamic require pattern was cargo-culted from
useChatKeyboard tests which use jest.doMock() and legitimately need
jest.resetModules(), but it served no purpose here and was actively harmful.1 parent b696c63 commit 4bf8ae5
1 file changed
Lines changed: 2 additions & 8 deletions
Lines changed: 2 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | | - | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | 36 | | |
42 | 37 | | |
43 | 38 | | |
44 | | - | |
| 39 | + | |
45 | 40 | | |
46 | 41 | | |
47 | 42 | | |
| |||
51 | 46 | | |
52 | 47 | | |
53 | 48 | | |
54 | | - | |
55 | 49 | | |
56 | 50 | | |
0 commit comments