Commit 8edaffe
fix(ui): drain React 19 scheduler before jsdom teardown in App.cloud-shell test
CI's "Client Tests" job failed with an unhandled `ReferenceError: window is
not defined` originating in `App.cloud-shell.test.tsx`. All 835 tests
passed, but a React 19 scheduler callback queued via `setImmediate` fired
after the per-file jsdom environment was torn down, after which `window`
no longer exists. Add an `afterAll` that awaits a `setImmediate` tick so
the scheduler's pending work runs while `window` is still alive, and an
`afterEach` that calls testing-library's `cleanup` to unmount any
straggler trees before the drain.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 947f17c commit 8edaffe
1 file changed
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
19 | 33 | | |
20 | 34 | | |
21 | 35 | | |
| |||
0 commit comments