Repository navigation
Commit aaa5bfc
committed
test(console): wait for the Building2 glyph with RTL's waitFor, not vi.waitFor (objectui#11690)
`getLazyIcon('Building2')` is lucide's DynamicIcon, a forwardRef that sets
its icon data from a promise its mount effect starts. `vi.waitFor` leaves
IS_REACT_ACT_ENVIRONMENT on, so when that update landed after
`findByText` restored the flag, React logged "An update to ForwardRef
inside a test was not wrapped in act(...)" through the console.error the
test holds silent, and the assertion that nothing is logged failed on some
runs. RTL's waitFor keeps the flag off while it waits, as findByText does.
iconNoise() and its assertion are unchanged.
Pre-existing on main: an in-process harness repeating the test's sequence
logged the ForwardRef warning on main 6be0f7a as on this branch, and never
with RTL's waitFor.
Claude-Session: https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8
Co-authored-by: Claude <noreply@anthropic.com>1 parent ec3561d commit aaa5bfc
1 file changed
Lines changed: 26 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
98 | 121 | | |
99 | 122 | | |
100 | 123 | | |
| |||
200 | 223 | | |
201 | 224 | | |
202 | 225 | | |
203 | | - | |
204 | | - | |
205 | | - | |
| 226 | + | |
206 | 227 | | |
207 | 228 | | |
208 | 229 | | |
| |||
216 | 237 | | |
217 | 238 | | |
218 | 239 | | |
219 | | - | |
220 | | - | |
221 | | - | |
| 240 | + | |
222 | 241 | | |
223 | 242 | | |
224 | 243 | | |
| |||
0 commit comments