Repository navigation
test(frontend): fail when the drawer hold catches no React Aria event - #427
Conversation
f0f5ed4 to
a5c8a09
Compare
The drawer tests hold scrollend on [data-sheet-scroll] and react-aria-sheet-close. If an upgrade renames one, the hold catches nothing, the flake from #397 comes back, and no test shows why. A healthy run of the six tests that use the hold catches nothing on a fast machine, so they cannot make the check. A new test waits for each event.
Two 5 s waits left 5 s of the default 15 s for the render and the input. On a slow runner a renamed event could then report a test timeout and not the message that names the event.
A stall over 5 s on a correct run failed with a message that blames an upgrade. The wait ends when the event arrives, so a longer limit costs a correct run nothing.
ee393a3 to
070eadd
Compare
|
PASS+NOTES
I did not write this code. The owner rebased the PR while I verified it. I first ran all lanes on head The guard. I made each change myself, one at a time, on both heads, and I restored it. I confirmed each restore with
Flake, on
Flake, on
The 10 s limit. It can still fail a correct run, but only on a freeze of more than 10 s during a short wait. I do not block on this.
The diff. Only Notes. None of these blocks.
|
Why
If a
react-aria-componentsupgrade renames an event that the drawer tests hold, the hold catches nothing and the flake from #397 comes back with no failing test to explain it. This PR adds a test that fails with a message that names the event.Closes #405
What changed
drawer.test.tsxopens a drawer with the hold on, and waits forscrollendon[data-sheet-scroll]. Then it presses Escape and waits forreact-aria-sheet-close. It also checks that the drawer stays indata-enteringand indata-exitingwhile the events are held, and that it closes when they are released.holdSlides()now returns{ endSlides, held }, so that the new test can read what it caught.Scope
endSlides(), because they press Escape before the slide ends. An assert in them would fail on a correct run.scrollendis a browser event, so an upgrade cannot rename it. An upgrade can stop waiting for it. The test catches that only if the slide ends within about 50 ms of the event.Tradeoffs
Blast Radius
Only the drawer test file changes. The new test adds about 1.2 s to the suite.
Verification
scrollendlistener, thereact-aria-sheet-closelistener, thedata-sheet-scrollattribute, and each of the two events no longer stopped. Before this change, all tests passed with both event names wrong.pnpm lintpasses, andpnpm testpasses 628 of 628 on the final base.