inspector/clients/web/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
cliffhall eae68f2fc6 test(web): await the theme observer instead of a wall-clock budget
The AppRenderer "live theme flip" test had its inner `waitFor` raised twice
(bare assertion -> 1000ms -> 5000ms) and failed a third time at 5032ms under
`local:gate` load. The budget was never the problem.

Root cause: happy-dom 20.11.1's `MutationObserverListener` stores its dispatch
callback as `new WeakRef((record) => this.report(record))` — an arrow function
nothing else holds strongly. A GC between `observe()` and the mutation collects
it, `callback.deref()` returns undefined in `Node[reportMutation]`, and the
mutation is dropped silently and permanently. That is why the failure tracks
machine load rather than any wall-clock value, and why no raise ever fixed it.

Reproduced directly against 20.11.1: an observer on `documentElement`, three
forced `global.gc()` passes, then `setAttribute` — callback count 0. Without
the forced GC, 1. Upstream holds the arrow strongly in a private field from
20.11.2 onward; the same probe against the bumped copy reports 1.

So:

- bump `happy-dom`'s floor to `^20.11.2` (lockfile resolves 20.14.5), which is
  the actual fix;
- replace the 5000ms `waitFor` with `flipThemeAttributeAndAwaitObservers`, an
  awaited condition per AGENTS.md: a probe MutationObserver registered after
  the component's is notified after it, so resolving on the probe's callback
  proves the component's already ran. No polling, no timeout, nothing
  load-sensitive.
- use the same helper in the two negative theme tests, which is what makes
  their "not called" a real gate rather than a vacuous pass on a flip that was
  never delivered.

The file's 52 tests now run in ~120ms.

Closes #2384

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: cliffhall <cliff@futurescale.com>
2026-09-16 08:58:21 -04:00
..
components test(web): await the theme observer instead of a wall-clock budget 2026-09-16 08:58:21 -04:00
hooks fix: address Copilot review round 3 on #2318 2026-09-13 22:53:08 -04:00
lib fix: the classifier does not survive structuredClone, and the test now proves it 2026-09-07 11:16:51 -04:00
test feat(test-servers): stall an OAuth endpoint so #2319's timeouts can be driven (#2383) 2026-09-16 02:10:29 -04:00
theme fix: bold the labels, not the values, and give Connection Info's URLs full width 2026-09-11 09:30:17 -04:00
types chore: close a batch of quality-gate & tidy gaps (#1785 #1787 #1789 #1790 #1767) (#1792) 2026-07-26 10:43:11 -04:00
utils Merge origin/v2/main into v2/feat/2318-timeout-diagnostics 2026-09-13 22:48:14 -04:00
App.css feat(web): use the Ace JSON editor everywhere, and restore the raw-JSON toggle 2026-08-27 02:24:22 -04:00
App.test.tsx feat(core): report connection state on a request timeout (#2318) 2026-09-13 21:25:31 -04:00
App.tsx feat(core): report connection state on a request timeout (#2318) 2026-09-13 21:25:31 -04:00
index.ts feat: port CLI, TUI, and launcher from v1.5 into v2 (#1452) 2026-06-14 20:27:49 -04:00
main.tsx fix(a11y): make the form error color meet WCAG AA in both schemes 2026-08-23 12:56:13 -04:00