Repository navigation
test(Tooltip): the fitting-tooltip wheel contract reads "still open" as the page starts to scroll - #8988
Conversation
…as the page starts to scroll The wheel scrolls the page 300 px, carrying trigger and tooltip out from under the resting pointer: a leave, so the tooltip closes after its hover bridge (Tooltip FR3). Checking "still open" after polling for the scroll only passed when the check beat the bridge. The state is now recorded at the first scroll event. Same checks. Test only. Original contract by @ejhammond in #8254.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Reading the tooltip's state at the first scroll event is a sound fix: it takes the check out of its race with the hover-bridge close that the scroll itself triggers, and the page-scroll and scroll-range assertions are unchanged. The updated test passed in Chromium and WebKit, including when a late check made the old version fail.
One optional follow-up: in Chromium this test alone no longer fails if the wheel closes the tooltip a task later (the tall-tooltip wheel tests still catch that). Wheeling only a few pixels keeps the surface under the pointer, so a check after the bridge stays deterministic and keeps that coverage here.
[Automated review]
Maintainer impact
The release-time accessibility contracts can go red on a correct Tooltip. In CI,
TooltipTallContent.a11y.browser.spec.ts› "a wheel over a tooltip that fits still scrolls the page" failed with the tooltip no longer in the page at its final check. A red release check on a healthy commit holds the release.Intended invariant
The contract is unchanged: a wheel over a tooltip that fits scrolls the page instead of being captured, the wheel does not dismiss the tooltip, and the tooltip has no scroll range of its own (
spec:AST-025FR14). Tooltip FR3 also still holds: once the pointer is over neither the trigger nor the tooltip, it closes after the hover bridge.Change
The wheel scrolls the page 300 px, which carries the trigger and the tooltip out from under the resting pointer. That is a leave, so the tooltip closes about 100 ms later, as FR3 specifies. The test checked "still open" after it had polled for the scroll, so it only passed when that check ran before the hover bridge expired. On a slow runner it doesn't.
The test now records the tooltip's state at the page's first
scrollevent: the moment the wheel has been passed on to the page, before the pointer has left. The checks are the same (open, and no scroll range of its own), read at the point where they answer the contract's question. Test only: no product code and no Changeset.Evidence
All runs were in Chromium against the Storybook built for the failing commit, with Playwright 1.61.1.
Scope
Testing
pnpm exec playwright test packages/core/src/Tooltip/__tests__/TooltipTallContent.a11y.browser.spec.ts --project chromium -g "fits still scrolls" --repeat-each=40 --fully-parallel, at normal load and under CPU saturation, before and after.prettier --checkandeslinton the file are clean.Credit: @ejhammond wrote this contract in #8254. This change only reads its "still open" check at the moment the wheel reaches the page.
Posted by Cindy's agent on her behalf.