[test][button] Add axe test coverage and WCAG conformance report - #48916
Conversation
Deploy previewBundle size
Check out the code infra dashboard for more information about this PR. |
9739034 to
3887296
Compare
212555a to
9b9147b
Compare
d60b37a to
5c23780
Compare
PR reviewNo findings. This PR sets the template for the stack and it is internally consistent. Checked: the demoMeta enrolment matches the 15 keys in Residual risk: the 371-line conformance report was spot-checked against the code, not verified claim by claim, and the new demos are regression-harness-only (not referenced from VerdictApprove - the enrolment, fixtures, tests, and report counts are consistent end to end. 🤖 Review generated with Claude Code |
JCQuintas
left a comment
There was a problem hiding this comment.
Reviewed the last commit only (5c23780), against master with #48915 and #48936 already in.
Looks good overall: the counts are self-consistent (23 + 4 + 0 + 28 = 55, which is exactly WCAG 2.2 A/AA once 4.1.1 is dropped, and the 8/27 flag count matches the body), the harness wiring is right (ButtonA11y* opted out of screenshots with ButtonA11yTextSpacing re-enabled by last-match-wins), the non-native tabIndex=-1 claim checks out against useButtonBase.ts, and all doc links resolve. Comments below are mostly wording accuracy on the report, since this text ends up published in #48926.
The one I would not merge without: the 1.4.3 known gap names only contained, but the same two palette colors fail as text and outlined labels too.
Two housekeeping notes:
- The branch is
CONFLICTINGwith master.Button.test.jsmoved toimport { describe, expect, it, vi } from 'vitest'upstream, so the addedimport { expect } from 'chai'hunk collides on rebase.sinon'sspyis still fine, 57 files inpackages/mui-material/srcstill use it. - Argos shows 1 added screenshot, which is
ButtonA11yTextSpacing. Expected, that is the demo the rule deliberately keeps enabled.
Non-blocking observation: ButtonA11yTextSpacing overlaps what #48936 already automates, since registerCssLayoutSuites injects TEXT_SPACING_CSS on /docs-components-buttons/BasicButtons. The inline comment already says it adds no unique axe coverage, so the value here is purely the permanent Argos snapshot. Fine if that is intended, just worth being explicit that it is a screenshot we now maintain forever.
5c23780 to
796e748
Compare
Each component PR appends its own row when its report lands. Empty rows read as gaps instead of work in progress. See mui#48916 (comment) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013HgD6GEW3UxNRvC2abbTy9
Applies mui#48916 (comment): the shared reports table starts empty, and each component PR appends its own row. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013HgD6GEW3UxNRvC2abbTy9
Applies mui#48916 (comment): the shared reports table starts empty, and each component PR appends its own row. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013HgD6GEW3UxNRvC2abbTy9
Applies mui#48916 (comment): the shared reports table starts empty, and each component PR appends its own row. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013HgD6GEW3UxNRvC2abbTy9
Applies mui#48916 (comment): the shared reports table starts empty, and each component PR appends its own row. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013HgD6GEW3UxNRvC2abbTy9
Applies mui#48916 (comment): the shared reports table starts empty, and each component PR appends its own row. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013HgD6GEW3UxNRvC2abbTy9
Applies mui#48916 (comment): the shared reports table starts empty, and each component PR appends its own row. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013HgD6GEW3UxNRvC2abbTy9
Applies mui#48916 (comment): the shared reports table starts empty, and each component PR appends its own row. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013HgD6GEW3UxNRvC2abbTy9
Applies mui#48916 (comment): the shared reports table starts empty, and each component PR appends its own row. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013HgD6GEW3UxNRvC2abbTy9
…he contrast ratio is off
JCQuintas
left a comment
There was a problem hiding this comment.
Re-reviewed at c423943. All 22 checks green, branch is mergeable again, and every point from the last round is addressed: the 1.4.3 table matches the WCAG math independently (3.11:1 for warning, 3.86:1 for info, closest pass primary at 4.6:1), the version reads 9.x, the 3.2.2 test now actually flips state via setProps, the reports index is trimmed to the row that exists, and the fixtures move resolves the "do not add docs demos" thread.
Four follow-ups, one of which I would fix before merge: the new contrast tests do not pin what they claim to pin.
The contrast guard moves to theme-level contract tests in a separate PR. Parsing the report table from a unit test was brittle, and the palette facts are not Button-specific. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013HgD6GEW3UxNRvC2abbTy9
A11y fixture suites use lowercase docs slugs as directory names. A
lowercase suite next to a PascalCase screenshot suite can differ only
by case, for example rating/ next to Rating/. Case-insensitive file
systems fold these into one directory. The new tree
test/regressions/a11y/fixtures/{slug}/ removes this risk. These routes
now use the /a11y-{slug}/{Demo} prefix. Screenshots are off by default
for this tree. Plain /regression-* routes are screenshot-only again.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013HgD6GEW3UxNRvC2abbTy9
The reporter created missing slug directories with mkdirSync. A badly named fixture suite could then write outside the docs tree. The reporter now compares each slug against the exact names from readdirSync and throws on a miss. existsSync is not sufficient: it folds case on macOS, so Rating would match rating/ and fail only on Linux CI. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013HgD6GEW3UxNRvC2abbTy9
Expands axe coverage for
Buttonand adds its WCAG 2.2 Level A/AA conformance report, plus the shared reports legend atpackages/mui-material/src/accessibility.md.Known gaps: contrast on
info/warningcontained buttons (1.4.3), focus-indicator contrast and its removal viadisableRipple(1.4.11, 2.4.7), and no live region for theloadingstate (4.1.3).Report:
Button/accessibility.mdImportant
How to review this PR
Layer 3 of 14 in a stacked series (#48915 → #48926). Its branch is built on
a11y/stack/css-layout(#48936). GitHub cannot chain PR bases across a fork, so every PR in the series targetsmasterinstead.Review only the last commit —
5c23780. Everything above it belongs to the layers below, and disappears as those merge.Original work by @mj12albert. Supersedes #48708, rebased onto current master.
Part of the WCAG conformance effort (#14187).