test(www): guard the status-badge title that the axe exclusion stopped checking - #860
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
playwright/axe-scope.tsexcludes 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: thetitleon the element. Delete it tomorrow and the suite stays green, having been told not to look.Two assertions, both mutation-verified
title— removing one fails itiframefails 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 failiframe) → exit 1; restored → exit 0🤖 Generated with Claude Code