git:20260811.0dc8891 to git:20260820.39518d3
1 added, 1 removed. Audit A to A.
# DOX โ packages/client/src/test-support
Files in this directory. One row per source file.
| File | Purpose |
|------|---------|
- | `virtualizer-jsdom.ts` | Vitest `setupFiles` shim (wired in `packages/client/vitest.config.ts`). jsdom lacks layout + `ResizeObserver`, so TanStack Virtual reads `offsetHeight`=0 and renders ZERO rows. Provides no-op `ResizeObserver` + reports tall `offsetHeight`/wide `offsetWidth` for ONLY the ChatView scroll container (`data-testid="chat-scroll-container"`), so ALL windowed rows mount for per-row content assertions (rows still measure 0). Global RTL `cleanup()` in `afterEach` unmounts every tree, then yields ONE macrotask when real timers are in effect (`vi.isFakeTimers()` guard โ under fake timers nothing advances the clock and the hook would hang to the 10 s test timeout). Both halves target the same failure: `cleanup()` blocks the post-teardown scheduler flush, the yield lets an ALREADY-scheduled TanStack Virtual debounce (`virtual-core/utils.js` `setTimeout`) fire while `window` still exists โ otherwise it reaches React's dispatch after the fork's jsdom is gone and the run exits 1 on `Errors 1` with every assertion passing. NOT a global `setTimeout` wrapper cancelling pending ids: that also intercepts `user-event`'s scheduling and broke the clipboard-fallback spec. See change: fix-tmux-session-shutdown-leak. `configure({ asyncUtilTimeout: 5_000 })` raises `waitFor`/`findBy*` poll ceiling under parallel-suite CPU oversubscription. Scroll/windowing BEHAVIOUR is Playwright-gated, not asserted here. See change: virtualize-chat-transcript-tanstack. |
+ | `virtualizer-jsdom.ts` | Vitest `setupFiles` shim (wired in `packages/client/vitest.config.ts`). jsdom lacks layout + `ResizeObserver`, so TanStack Virtual reads `offsetHeight`=0 and renders ZERO rows. Provides no-op `ResizeObserver` + reports tall `offsetHeight`/wide `offsetWidth` for ONLY the ChatView scroll container (`data-testid="chat-scroll-container"`), so ALL windowed rows mount for per-row content assertions (rows still measure 0). Global RTL `cleanup()` unmounts every tree. The layout shim records any ChatView scroller access, including a later manual unmount. Real-timer ChatView tests then wait 160 ms for TanStack Virtual's 150 ms scroll-reset callback; fake-timer and non-ChatView tests skip the wait. This prevents the callback from reaching React after jsdom removes `window`, which otherwise exits the run on `Errors 1` after all assertions pass. NOT a global `setTimeout` wrapper cancelling pending ids: that also intercepts `user-event`'s scheduling and broke the clipboard-fallback spec. See change: fix-tmux-session-shutdown-leak. `configure({ asyncUtilTimeout: 5_000 })` raises `waitFor`/`findBy*` poll ceiling under parallel-suite CPU oversubscription. Scroll/windowing BEHAVIOUR is Playwright-gated, not asserted here. See change: virtualize-chat-transcript-tanstack. |