Repository navigation
test(a11y): wait for the consent banner so axe actually checks it - #405
Conversation
Both axe suites deliberately skip granting consent so the undecided consent banner — sitewide chrome — is held to the same accessibility bar. That only works if axe waits for it, and it wasn't: the banner is client-rendered and lands 100-200ms AFTER document.fonts.ready, which is the point both suites analysed at. Measured per route, it was absent at fonts.ready on /, /components and /templates, and present on a warm /templates/<slug> — so the coverage the comments claimed was really down to how warm the server was, and inconsistent between routes in the same run. Both suites now wait for [data-consent-banner] (the hook consent.e2e.spec.ts already uses) before analysing. The wait doubles as an assertion that the banner is on those routes at all; it passes on every route in both suites, which is what makes the stated scope real rather than incidental. The template preview routes are exempt because AnalyticsShell returns null there, an exemption templates.e2e.spec.ts already pins. No violations surfaced once the banner was reliably in scope, including against the per-provider banner #400 reshaped — but that is now a checked fact rather than a coin toss. Co-Authored-By: Claude Opus 5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughE2E accessibility suites now wait for the client-rendered consent banner before running axe analysis. The template suite adds optional banner waiting to its settling helper and enables it for gallery and detail routes. ChangesConsent banner accessibility gating
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed: dependency version conflict. Check your lock file or package.json. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…r adoption, template a11y (#409) Brings main level with dev (137 commits). Headline items: - the component wall no longer crops blocks: per-breakpoint zoom pins the twins' inner layout width at 1280px (#392), and the 640-1023px band gets a 256px frame plus a widened fade (#399). Production was cutting content-quote, content-feature-media and content-feature-split by 88/79/78px on a tablet; measured on the live site, not inferred. Three viewport tests now assert the fit so a curated-at-one-width regression cannot recur silently. - prettier is adopted: config matched to the house style (#402), the tree formatted, and format:check gated in test:release and the CI lint step (#408). - template a11y and layout fixes (#394, #398, #404), consent gate split by provider (#400), axe now waits for the consent banner (#405), CodeQL double-escaping fix (#391). Tree is identical to dev by construction: branched from dev, reparented onto main, so the diff is exactly the main..dev delta with no squash-divergence conflicts.
Found while verifying that
dev's tip was still green after #394, #398 and #404 all landed via--adminalongside #400, which reshaped the consent banner. The combination is fine — but checking it turned up something else.The problem
Both axe suites deliberately don't grant consent, so the undecided consent banner is part of what gets checked.
templates.e2e.spec.tseven says so: "the axe suites deliberately run without consent so it is still held to the a11y bar."That was not actually happening. The banner is client-rendered and lands 100–200 ms after
document.fonts.ready— which is exactly the point both suites were analysing at. Measured per route:fonts.ready?/templates//components/templates/saas-launchSo the coverage came down to how warm the server was, and it differed between routes in the same run. On a warm route the banner was checked; on a cold one it wasn't. Worst of both: not covered, and not consistently uncovered either.
The fix
Both suites now wait for
[data-consent-banner]— the hookconsent.e2e.spec.tsalready uses — before analysing.The wait doubles as an assertion that the banner is on those routes at all, and it passes on every route in both suites. That is what makes the documented scope real rather than incidental. Template preview routes are exempt because
AnalyticsShellreturns null there, an exemptiontemplates.e2e.spec.tsalready pins.What it found
Nothing — no violations surfaced once the banner was reliably in scope, including against the per-provider banner #400 introduced. That is the good outcome, and it is now a checked fact instead of a coin toss.
Verification
pnpm test:releasegreen — batches 44 / 69 / 102 / 43 / 133, int 379 passed. I also randev's tip unmodified beforehand to confirm the three recently-merged PRs and #400 don't conflict: also green.🤖 Generated with Claude Code
Summary by CodeRabbit