Repository navigation
test(AspectRatio): the fit-layer spec answers the story's remote photos locally - #9703
Conversation
…os locally The FitModes story loads its photos from picsum.photos. The spec opens the story, then calls page.setContent, which waits for the load event, and Chromium does not fire it while those photo requests are in flight. When picsum answered slowly, each case waited out the 60 s test timeout. The spec now routes picsum.photos to a local SVG before it opens the story, so it never waits on the network. No timeout changes.
|
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 |
|---|---|---|---|
| AspectRatio · Storybook | 3.8 kB (0) · 3.6 kB CSS (0) | 109 (0) | ✓ · ✓ · — |
Package size: no published package changed; no new dependencies.
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.
This looks ready to approve, with no blocking findings.
The spec now answers the FitModes story's picsum.photos requests with a local SVG before it opens the story, so a slow photo host can no longer hold the load event that page.setContent waits for. With picsum.photos held open, the current spec times out in page.setContent on every case, while this version passes all six. The captured markup, CSS and assertions are unchanged, so the spec still proves what it did.
[Automated review]
Maintainer impact
The release check fails in
AspectRatioFitLayers.a11y.browser.spec.tswhenever picsum.photos answers slowly: each case waits out the 60 s test timeout inpage.setContent. Nothing is wrong with AspectRatio. The FitModes story loads its photos from picsum.photos; the spec opens the story, then callspage.setContent, which waits for the load event, and Chromium does not fire it while those photo requests are in flight.Intended invariant
The spec's claims are unchanged: it still captures the FitModes story's real markup and compiled CSS and proves
fitfills the box on each documented setup. Only its inputs become local.Change
Before it opens the story, the spec routes
**://picsum.photos/**to a local SVG, so no request leaves the machine. The Lightbox specs already route picsum.photos for their own stories (they abort the requests). No timeout changes.Evidence
Failure before the change: with picsum.photos held open, main's spec fails 6 of 6, each with "page.setContent: Test timeout of 60000ms exceeded". On a machine whose network reaches picsum slowly, main's spec failed 3 of 6 the same way with no seam.
Success after the change: with picsum.photos held open, this spec passes 6 of 6 in 6.3 s (Testing).
Product/runtime behavior verified unchanged: test-only; no product file changes.
CI impact: none.
Other specs that load remote URLs: a census loaded all 2,599 stories in a fresh build and recorded each request that would leave the machine (local probe, not part of the diff). 103 stories make such requests (picsum.photos, i.pravatar.cc, cdn.jsdelivr.net, images.unsplash.com and others). Four browser specs open one of those stories: this one, the two Lightbox specs (which abort the picsum requests) and
CardPress.a11y.chromium.spec.ts(which answers every outside request locally). No other browser spec opens one.Scope
Testing
Red-first at
3ba0528234(this head, one commit on maine0eac233d8), against a fresh Storybook build of that main, with a local seam (a route that never answers picsum.photos; local probe, not part of the diff):Local gates at
3ba0528234:playwright test --config playwright.config.ts --project=chromium, thetest:a11y-contractcommand): 60 of 60 pass. WebKit under the CI WebKit job's command: 6 of 6.pnpm check:repo,pnpm check:changesetsandpnpm specs:for --diff origin/main(no routed claims).pnpm buildpasses.pnpm test:uiandpnpm test:nodewith--changed=origin/mainfind no affected unit test.