Repository navigation
test(CheckboxList): a row adds no touch-query listener of its own - #10046
Conversation
The CheckboxList case that counts touch-query listeners asserted exactly one live listener, and none right after the rows unmount. Since the List rows' touch target landed (meta#8085), every row also takes a hit-area watch, and that utility keeps one shared listener of its own. Its last release waits one microtask, so a ref that attaches again in the same commit keeps its watch. On main the case therefore failed: two listeners, and one left until the next microtask. The case now asserts what it is for. The stub sees the shared watches, forty rows hold what one row holds, and none remain once the rows unmount and one microtask passes. A listener added per row fails it (42 against 3), and so does one that is never removed (1 left).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| CheckboxList | 45.6 kB (0) · 7.5 kB CSS (0) | — | — · ✓ · ✓ |
| CheckboxListItem | 59.6 kB (0) · 10.7 kB CSS (0) | — | — · ✓ · ✓ |
Package size: no published package changed; no new dependencies.
API changes: none in this pull request
Committed API report behind this build: cli 9 rows, core 4 rows; run pnpm api:report.
Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Approved pending CI: CI has not finished on this head yet.
The rewritten case checks what it exists for: forty rows hold the same (pointer: coarse) listeners as one row, and none remain once the rows unmount and one microtask passes. It fails on main for the reason the description gives, passes on this head, and catches a listener added per row. No product code, public API or spec record changes.
[Automated review]
Maintainer impact
Every pull request's unit job fails on main: CheckboxList's "holds one touch-query listener however many rows there are, and none once they unmount" expects 2 to be 1. Two changes that each passed alone met there. The CheckboxList row press (#8212) counted exactly one live
(pointer: coarse)listener. The List rows' touch target (#8085) then gave every row a hit-area watch, with one shared listener of its own.Intended invariant
A repeated row adds no touch observer of its own, and no listener outlives the rows. The case exists to hold that for the shared watch in
hooks/useMediaQuery.tsand the hit-area watch inutils/touchHitArea.ts.Change
The case asserts the invariant, not a count. It renders one row, then forty. The stub must see the shared watches, forty rows must hold what one row holds, and none may remain once the rows unmount and one microtask passes. That microtask is the hit-area watch's own: its last release waits one, so a ref that attaches again in the same commit keeps its watch. The fine and coarse pointer runs and the press-marker check stay. No product code changes.
Evidence
(pointer: coarse)listener added per row fails the forty-against-one check ("expected 42 to be 3"). The same listener, never removed, fails the release check ("expected 1 to be 0").Scope
Testing
pnpm test:uiat this head, on main e657e2e: 838 files, 21,086 tests, all passing.tsc, ESLint and Prettier on the changed file,check:repo,check:changesets, changeset coverage against v0.7.8,check:knowledgeandpnpm review:pre(0 findings): clean.