[test][avatar] Add axe tests and WCAG conformance report - #48917
[test][avatar] Add axe tests and WCAG conformance report#48917michelengelen wants to merge 4 commits into
Conversation
Deploy previewBundle size
Check out the code infra dashboard for more information about this PR. |
148c44e to
82a6d6d
Compare
9e4e570 to
644a4c7
Compare
69a1db9 to
2edd548
Compare
Lets a fixture assert every axe rule it exercises rather than only the CSS-dependent visual ones, which is what the per-component WCAG reports need.
Adds a table-driven Playwright suite covering 1.4.10 Reflow, 1.4.4 Resize Text and 1.4.12 Text Spacing across the assessed components. axe has no rule for any of them, so they were rated Manual on evidence from source review.
2edd548 to
1482433
Compare
PR reviewNothing merge-blocking. The unit tests are precise (fallback icon hidden, decorative SvgIcon hidden) and the two-layer demoMeta rules resolve correctly under last-match-wins. One redundancy against the css-layout suite and one optional hardening. Simplifications (1)1. 🟡 The bespoke Avatar 1.4.12 test duplicates the css-layout suiteLocation: describe('Avatar', () => {
test('1.4.12 Text Spacing: initials stay visible under the WCAG overrides', ...#48936, earlier in this stack, already runs 1.4.12 on Failure scenario: two tests cover one criterion; a future change updates the generic suite's thresholds and leaves this copy behind, and the two drift apart. Fix: remove the bespoke Tests (1)2. ℹ️ Avatar demos assert only visual axe rulesThe avatar rules omit VerdictApprove after nits - correct enrolment and tests; the duplicate 1.4.12 check is worth removing. 🤖 Review generated with Claude Code |
Adds axe coverage and the WCAG 2.2 Level A/AA conformance report for
Avatar, plus an a11y-only fixture for image avatars.Known gaps: default letter/fallback avatars render white on
grey[400](~1.9:1) (1.4.3), and meaningful icon avatars fall below 3:1 (1.4.11).Report:
Avatar/accessibility.mdImportant
How to review this PR
Layer 4 of 14 in a stacked series (#48915 → #48926). Its branch is built on
a11y/stack/button(#48916). GitHub cannot chain PR bases across a fork, so every PR in the series targetsmasterinstead.Review only the last commit —
1482433. Everything above it belongs to the layers below, and disappears as those merge.Original work by @mj12albert. Supersedes #48732, rebased onto current master.
Part of the WCAG conformance effort (#14187).