Repository navigation
test(DateInput): the wheel pinch-zoom spec opens its minute wheel at a fixed time - #8332
Conversation
|
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.
One more change is needed: the one-row bar is reasonable, but the one-finger case still depends on the clock, so the flake is not gone. The story's bottom-sheet TimeInput has no value, so the Minute wheel opens on the current minute and row 59 is the end of its scroll: the #8123 run started at :57 and stopped at that end (1596 → 1652), and a run that starts at :59 cannot scroll at all, so scrollTop >= before + row fails with 1652 against 1680. Please pin the clock before the story loads, for example await page.clock.setFixedTime(new Date(2026, 0, 1, 10, 30)) in a beforeEach (the Schedule time-grid spec pins its clock for the same reason), and reword the comment to name the start minute.
[Automated review]
| .locator('[role="option"]') | ||
| .first() | ||
| .evaluate(el => el.getBoundingClientRect().height); | ||
| expect(await wheel.evaluate(el => el.scrollTop)).toBeGreaterThanOrEqual( |
There was a problem hiding this comment.
This still fails whenever the story opens during minute :59. The story's bottom-sheet TimeInput has no value, so the Minute wheel starts on the current minute, and row 59 is its scroll end (scrollTop 1652): at :59 the drag cannot move it a row, and the assertion reports 1652 against >= 1680. The #8123 failure is the same end reached from :57 (1596 → 1652).
Pinning the clock before page.goto removes the dependence; the comment above can then name the start minute instead of a partial drag:
test.beforeEach(async ({page}) => {
await page.clock.setFixedTime(new Date(2026, 0, 1, 10, 30));
});There was a problem hiding this comment.
Right, that's the cause: the wheel opens on the current minute, and row 59 is the end of its scroll. Fixed in 9d5aee5:
- a
beforeEachpins the clock to 10:30 before the story loads; - scrollTop is polled instead of waiting 600 ms;
- the comment names the start minute.
Pinning 10:59 instead reproduces the #8123 failure (1652 against ≥ 1680). At 10:30 both cases pass 16 of 16. The commit message and the description now give this root cause.
…a fixed time The spec's story has a bottom-sheet TimeInput with no value, so its Minute wheel opens on the current minute, and the minute list ends at 59. The one-finger case drags the wheel up 120 px and asserted that it scrolled more than 60 px, so a run in the last minutes of an hour failed: from :57 the column can scroll only two 28 px rows before it reaches row 59 (1596 to 1652, the pr-a11y failure on meta#8123), and from :59 none at all. The spec now pins the clock to 10:30 before the story loads, polls scrollTop instead of sleeping 600 ms, and asks for at least one row, measured from the rendered option.
11cc210 to
9d5aee5
Compare
There was a problem hiding this comment.
Looks good to merge: pinning the page clock to 10:30 before the story loads removes the time-of-day dependence that failed the one-finger case whenever it opened during the last three minutes of an hour, and the one-row bar still fails when one-finger panning is removed. No further changes are needed.
[Automated review]
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewModified ComponentsDateInput (@astryxdesign/core) · View in Storybook
Bundle Size SummaryGzip figures measure each package's entry file, not the code an import pulls in.
Accessibility AuditStatus: No accessibility violations detected. Visual RegressionStatus: No visual change across 2 compared shot(s). Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
Maintainer impact
The picker wheel pinch-zoom contract in
pr-a11yfails in the last minutes of an hour, on PRs that don't touch the wheel. On #8123 (run 40137962720, job 121010245944) it expected scrollTop > 1656 and got 1652.Intended invariant
The one-finger case proves that one finger still scrolls a picker wheel and leaves the page at scale 1 (WCAG 1.4.4); the pinch case beside it proves the zoom. Neither depends on the time of day.
Change
The spec's story has a bottom-sheet TimeInput with no value, so its Minute wheel opens on the current minute, and the minute list ends at 59. The one-finger case drags the wheel up 120 px and asserted that it scrolled more than 60 px. Its rows are 28 px, so from :57 the column can scroll only two rows before it reaches row 59: 57 × 28 = 1596 to 59 × 28 = 1652, the failure above. From :59 it can't scroll at all.
The spec now:
page.clock.setFixedTime, in abeforeEach), so the wheel opens on :30 with rows to go;Only the spec changes.
Evidence
--repeat-each 8).Scope
Testing
16 passed (42 s). With the clock pinned to 10:59 instead, the one-finger case fails as on #8123.