Skip to content

test(www): guard the status-badge title that the axe exclusion stopped checking - #860

Merged
choraria merged 1 commit into
mainfrom
lane/a11y-badge-title-guard
Jul 31, 2026
Merged

test(www): guard the status-badge title that the axe exclusion stopped checking#860
choraria merged 1 commit into
mainfrom
lane/a11y-badge-title-guard

Conversation

@choraria

Copy link
Copy Markdown
Contributor

playwright/axe-scope.ts excludes the Phare status-badge iframes from the a11y audit — correctly: axe walks into frames, a violation in a vendor's cross-origin document isn't fixable by us, and when the injection races it reds ~55 tests at once (three times in two days).

But .exclude() drops the element and its subtree, so axe no longer checks the one thing about those iframes that is ours: the title on the element. Delete it tomorrow and the suite stays green, having been told not to look.

Two assertions, both mutation-verified

  • every status-badge iframe has a non-blank title — removing one fails it
  • the guard and the exclusion share one constant, so widening the exemption to iframe fails it too. Otherwise the test would keep asserting the old shape while the exclusion quietly grew.

The count is pinned at two (light + dark) so it can't pass by matching nothing — a vendor change breaking the selector is exactly when this most needs to fail.

Found while verifying a memory that said "do the exclude() fix": it had already been done. Checking beat trusting the note, and turned up the hole the fix left.

Test plan

  • pnpm lint — 0 fail
  • Mutation A (drop a title) → exit 1; Mutation B (widen exclusion to iframe) → exit 1; restored → exit 0

🤖 Generated with Claude Code

…d checking

`playwright/axe-scope.ts` excludes the Phare status-badge iframes from the
accessibility audit, and that exclusion is right: axe walks INTO frames, a
violation inside a vendor's cross-origin document is not something we can fix,
and when the injection races it takes the whole suite with it — ~55 tests at
once, three times in two days.

But `.exclude()` drops the element AND its subtree, so axe no longer checks the
one thing about those iframes that IS ours: the `title` on the element itself.
Delete it tomorrow and the suite stays green, having been told not to look. An
exemption is only as safe as whatever replaces what it gave up, and nothing did.

Two assertions, both mutation-verified rather than assumed:

  · every status-badge iframe has a non-blank title — removing one fails it;
  · the guard and the exclusion share ONE constant, so widening the exemption to
    `iframe` fails it too. Otherwise the test would keep asserting the old shape
    while the exclusion quietly grew, and the gap would reopen in silence.

The count is pinned at two (light and dark) so the test cannot pass by matching
nothing — the failure mode where a vendor change makes the selector stop
matching is exactly when this most needs to fail.

Found while verifying a memory that said "do the exclude() fix": it had already
been done by a later session. Checking beat trusting the note, and the check
turned up the hole the fix left behind.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BRmGUnxeYsQoG9c8BCZcae
@choraria
choraria merged commit 31954cf into main Jul 31, 2026
31 checks passed
@choraria
choraria deleted the lane/a11y-badge-title-guard branch July 31, 2026 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant