Repository navigation
test(Lightbox): run the keyboard and viewport specs on Lightbox changes - #11524
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec f545d08 |
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| Lightbox · Storybook | 144.7 kB (0) · 11.5 kB CSS (0) | 4,665 (0) | ✓ · ✓ · ✓ |
Package size: measured; main has no measurement of the merge base to compare yet.
API changes: unknown (base surface unavailable): richtext, theme-butter, theme-chocolate, theme-gothic, theme-matcha, theme-neutral, theme-stone, theme-y2k
Touched components checked; add ci:run-visual or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Changes requested. The routing change itself matches the CI routing spec: Lightbox's two specs now run on Lightbox pull requests in the contract job, and the release check still runs every spec. Two statements in the description need correcting:
- The description says a change only to
Link/Link.tsxorLayer/useLayer.tsxno longer selects these specs, but the contract job also runs the scoped specs of folders that render a touched component, so after this change aLink.tsxchange runsLightboxKeyboard.a11y.browser.spec.tsthere (and listsLightboxViewportas not run); please say so in the Evidence and CI impact bullets. - The description and the commit message say the
pr-a11yjob starts both specs on every pull request, but on a pull requestpr-a11yruns only with theci:run-a11ylabel, so please say "every pull request labelledci:run-a11y".
No code change is needed; CI has not run on this head yet because the pull request is a draft.
Claims and files checked
- Claim: both specs were
alwaysand check only Lightbox: verified. - Claim:
pr-a11ystarts both on every pull request: false, it runs only withci:run-a11y. - Claim: the contract job skipped them on a Lightbox change: verified.
- Claim: the contract job runs a touched component's scoped specs and no unchanged
alwaysspec: verified against the CI routing spec. - Claim: a spec with no
always,auditorrelease-onlyline is scoped: verified in the routing parser. - Claim: the release check still runs every spec: verified, its contract legs run every listed test.
- Claim: the new routing line adds the Lightbox stories, like the Avatar and AppShell specs: verified.
- Claim: only the two routing comments change, with no test body change: verified.
- Claim: before, an Avatar-only change selects both as
always, and a Lightbox change selects neither in the contract job: verified by replaying the routing. - Claim: after, an Avatar change selects neither, a Lightbox change selects both in both modes, and a Lightbox story change selects both in the labelled run: verified by replaying the routing.
- Claim: a Link or Layer change no longer selects these specs: false for the contract job.
- Claim: the two specs hold 45 tests per browser: count verified, not run here.
- Claim: recorded times of 3.8 s and 2.2 s: verified.
- Claim: a Lightbox change now runs them in the contract job: verified.
- Claim: no public API or product behavior change: verified, the API surface comparison shows no rows.
- Claim: strict ESLint, Prettier, the routing tests and the pre-review script pass: verified.
- Claim: the other open pull request that edits the viewport spec merges cleanly with this one: verified.
- File
packages/core/src/Lightbox/LightboxKeyboard.a11y.browser.spec.ts: finding, it now joins the contract job's specs for folders Lightbox renders, which the description denies. - File
packages/core/src/Lightbox/LightboxViewport.a11y.browser.spec.ts: clear.
Both accessibility specs check only Lightbox, yet every pull request labelled ci:run-a11y ran them. They are now scoped to the Lightbox folder and its stories, like the Avatar specs, so the component contract check runs them when Lightbox changes.
f545d08 to
fc5d04c
Compare
|
/approve-spec fc5d04c |
There was a problem hiding this comment.
Approved pending CI. Moving both Lightbox specs from always to a Lightbox scope matches the CI routing spec: Lightbox pull requests now run them in the component contract job, a change to a folder Lightbox renders plans them in that job's one-minute share, and the release check still runs them. The description and commit message now match what the routing does. CI has not run on this head because the pull request is a draft; it runs once the pull request is marked ready for review.
Claims and files checked
Claims:
- Both specs were routed
alwaysand check only Lightbox: its keys, focus, sizing and caption: verified: line 2 at the merge base; the specs' headers and the Lightbox record's caption-band cases - The labelled accessibility job started both on every pull request labelled
ci:run-a11y, whatever it changed: verified:alwaysreturns before any path check (a11y-pr-contracts.mjs:279); the jobs need the label (ci.yml:2247,:2384,:2471,:2575) - The component contract job skipped them on a Lightbox change: verified: owned specs exclude
always(a11y-pr-contracts.mjs:384-396); replay before the change - The contract job runs a touched component's scoped specs and no unchanged
alwaysspec: verified against AST-030 FR12 - A spec with no
always,auditorrelease-onlyline is scoped: verified:parseRoutingdefault (a11y-pr-contracts.mjs:85,:121) - The release check still runs every spec: verified:
a11y-contractsruns every listed test (ci.yml:2654-2655) - The new line scopes both specs to the Lightbox folder and stories, as the Avatar and AppShell specs do, with no test body change: verified: the diff is line 2 only; the Avatar and AppShell specs carry the same token shape;
apps/storybook/stories/Lightbox.stories.tsxexists - Before and after dry runs for Avatar, Lightbox and Lightbox-story changes: verified: routing replay on the head and on the head merged into
main - A Link or Layer change no longer selects them in the labelled run; the contract job plans them within its six-minute plan and one-minute share, else lists them as not run: verified: the labelled scope has no dependents (
a11y-pr-scope.mjs:128-186); replay: Link runs the keyboard spec and lists the viewport spec as not run, Layer lists both as not run - Only the two routing comments change; product behavior is unchanged: verified: the diff, and 0 API surface rows for Core and the seven themes
- Together the specs pass 45 tests in Chromium and 45 in WebKit: verified: 45 tests listed in each project; all 45 pass in Chromium; WebKit was not re-run
- Recorded times 3.8 s and 2.2 s: verified:
.github/a11y-contract-durations.json:120-121 - The head keeps the tested commit's tree; only the commit message changed: verified: identical trees and parent
- Strict ESLint and Prettier pass; routing tests pass 101/101 in 3 files; pre-review reports 0 findings: verified: rerun at the head
- #11205 edits the viewport spec in another hunk and the two merge cleanly: verified: its hunk starts at line 257; the merge has no conflict
- The commit message: labelled pull requests ran both specs; they are now scoped so the contract check runs them on Lightbox changes: verified, as above
Files:
packages/core/src/Lightbox/LightboxKeyboard.a11y.browser.spec.ts: clearpackages/core/src/Lightbox/LightboxViewport.a11y.browser.spec.ts: clear
Maintainer impact
LightboxKeyboard.a11y.browser.spec.tsandLightboxViewport.a11y.browser.spec.tscarry@pr-a11y always, though they check only Lightbox: its keys, focus, sizing and caption. So thepr-a11yjob starts both on every pull request labelledci:run-a11y, whatever it changes. Meanwhile thepr-component-a11y-contractsjob skips them on a Lightbox change, since it runs no unchangedalwaysspec.Intended invariant
AST-030 FR12's contract job runs the
scopedspecs that each touched component owns, and no unchangedalwaysspec. A spec with noalways,auditorrelease-onlyline isscoped. The release check still runs every spec ina11y-contracts.Change
Each spec's routing line becomes
// @pr-a11y scope ^packages/core/src/Lightbox/ ^apps/storybook/stories/Lightbox, so the spec isscoped. The second token adds the Lightbox stories, as the Avatar and AppShell specs do. No test body changes.Evidence
Avatar.tsxselects both specs asalways. A--changed-onlydry run for aLightbox.tsxchange selects neither.Lightbox.tsxchange selects both, in the plain and the--changed-onlydry run. A change to the Lightbox stories selects both in the plain dry run.Link/Link.tsxorLayer/useLayer.tsx, changes how they run. The labelled run resolves changed components without their dependents, so it no longer selects them. The contract job now plans them as specs of a folder that renders a touched component. Each runs if it fits that job's six-minute plan and its one-minute share, and is otherwise listed as not run. The release check still runs every spec.pr-a11yjob. Their times in.github/a11y-contract-durations.jsonare 3.8 s and 2.2 s. A Lightbox change now runs them in thepr-component-a11y-contractsjob, and a change to a module Lightbox uses may run them there.Scope
Components: Lightbox
Testing
pnpm review:prereports 0 findings.pnpm test:a11y-contract:pr origin/main --dry-run, on this branch with an Avatar, Lightbox, Lightbox-story,useLayer.tsxorLink.tsxchange added locally, and on main the same way.--changed-onlyrun with--owned-by Link --dependents-of core/Link, and with--owned-by Layer --dependents-of core/Layer. Before, neither lists these specs. After, both list them, as run or as not run.node .github/scripts/a11y-pr-contracts.mjs --changed-only <specs> --changed-files <files> --owned-by Lightbox --dry-run, before and after.LightboxViewport.a11y.browser.spec.ts, in another hunk. The two merge clean in either order.