Repository navigation
test(Lightbox): the viewport spec skips only a cross-origin stylesheet - #9064
Conversation
The spec read every stylesheet's rules inside an empty catch, meant for a cross-origin sheet whose rules a page can't read; it would also have swallowed any other error and let the proof pass on what it never read. It now skips only a sheet whose href has another origin, and lets anything else throw.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewModified ComponentsLightbox (@astryxdesign/core) · View in Storybook
Component Size
Sizes are gzip. Import counts the JavaScript the import loads eagerly; CSS counts the package stylesheet rules referenced by the modules it can load from its own package, lazily loaded ones included. Bundle Size SummaryGzip figures measure each package's entry file, not the code an import pulls in.
Accessibility AuditStatus: The accessibility audit did not run on this pull request. It runs after merges to Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
There was a problem hiding this comment.
Looks good: the viewport proof now skips only a stylesheet served from another origin, so any other read error fails it with its own message instead of being swallowed. An injected stylesheet read error fails the updated proof where the old walk let it pass, and without one the proof still passes in Chromium and WebKit. CI has not run yet: it starts once the pull request is ready for review and, because it comes from a fork, carries the ci:run label.
[Automated review]
Maintainer impact
LightboxViewport.a11y.browser.spec.tschecks that the open viewer declaresheight: 100dvhby reading the page's stylesheets. Each sheet's walk sat inside an emptycatch, meant for a cross-origin sheet whose rules a page can't read. That catch swallowed every other error too, so a same-origin sheet that failed to read was skipped in silence: the proof could pass on CSS it never read, or fail on a missing100dvhthat hid the real error.Intended invariant
The proof's claim is unchanged: the open viewer declares
height: 100dvh, so Safari's toolbar can't cover its caption (#8732). Only how it skips an unreadable sheet changes.Change
The walk now skips only a sheet whose
hrefresolves to another origin, and reads every other sheet with nocatch, so any other error fails the proof. One test file and no product code, so no changeset.Found while auditing the Lightbox proofs for catch blocks that could hide a failure. Prior art: no open pull request touches this spec (searched open pull requests for
LightboxViewport,cross-origin stylesheetandstyleSheets catch).Evidence
100dvhrule, the spec on main passes; injected into every sheet, it fails on "expected [] to contain '100dvh'" rather than on the error.Scope
Testing
Local gates at fd830f7 (on main d73908f):
pnpm check:repo,pnpm typecheck(0 errors), ESLint and Prettier on the spec, the root build and the Storybook build pass.pnpm test:ui: 16,446 tests pass.pnpm test:node: 14,502 pass; its 4 failures, instory-tree.test.tsand the releasecache.test.mjs, are independent of this change (test(storybook): run the story-tree check where Storybook is built, and bring the tree back to its shape #8509, fix(cli): a crashed run's release install is recognized by the Node it ran on, whatever its name #8520).