Skip to content

[test][form helper text] Add axe tests and WCAG conformance report - #49553

Open
michelengelen wants to merge 18 commits into
mui:masterfrom
michelengelen:feature/mat-2025-a11yformhelpertext-assess-wcag-22-conformance
Open

michelengelen wants to merge 18 commits into
mui:masterfrom
michelengelen:feature/mat-2025-a11yformhelpertext-assess-wcag-22-conformance

Conversation

@michelengelen

@michelengelen michelengelen commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Adds axe coverage, WCAG unit tests, and a WCAG 2.2 Level A/AA conformance report for FormHelperText. This is Wave 1, item 7 of #49260. Part of #49411.

FormHelperText

Result Count
✅ Supports 11
⚠️ Partially Supports 2
❌ Does Not Support 0
➖ Not Applicable 42
🚩 Flagged 3/13

Known gaps:

  • 1.4.3 Contrast (Minimum). In dark mode, the Paper elevation overlay lowers the contrast of the default error.main (#f44336). Error text falls below 4.5:1 from elevation 2: about 4.3:1 at elevation 2, 3.69:1 at elevation 8 (Menu, Popover), and 3.14:1 at elevation 24 (Dialog). At elevation 1, it is about 4.5:1, which is borderline.
  • 4.1.3 Status Messages. The helper text has no live region. A screen reader probably does not announce an error that appears on blur until the user moves focus back to the field. This matches the TextField report.

Report: FormHelperText/accessibility.md

Changes

  • Tests. The FormHelperText.test.js "WCAG 2.2 conformance" block covers:
    • 1.3.1: FormControl does not connect a standalone helper text to an Input. An existing TextField test covers the TextField description. The 3.3.1 test covers the connection that the author sets.
    • 1.4.3: the resting and error colors reach 4.5:1 in light mode. A second test renders the error text in a dark Paper at elevation 1, 2, and 24. It blends the computed overlay of the Paper with its background color, and measures the text against the result. It asserts a ratio from 4.5:1 to 4.6:1 at elevation 1, and less than 4.5:1 at elevation 2 and 24 (documented gap). This test runs only in the browser test projects.
    • 3.3.1: a standalone Input in an error FormControl gets aria-invalid="true" and the helper text as its description.
    • 4.1.3: no live region on the helper text, and no [aria-live], [role="status"], or [role="alert"] anywhere in an error TextField (documented gap).
  • axe. FormHelperText has no docs page, so it follows the pattern of [test][FormControlLabel] Add axe tests and WCAG conformance report #49524: two fixtures own a new form-helper-text slug.
    • FormHelperTextA11yStates (standalone) asserts every rule.
    • FormHelperTextA11yVariants covers the three TextField variants, in the resting and error states. It records color-contrast without asserting it. The red label of the filled error field is a known TextField 1.4.3 failure that this fixture shows. axe can also return incomplete results where an input is empty or where the notched outline and the floating label overlap it. The stored result is a fail, and it does not name the failing element. Thus it does not show that the helper text passes there. The states fixture asserts color-contrast on the helper text.
  • Playwright. FormHelperText is in the CSS layout suite on its states fixture.
  • Known gaps.

Decisions for review

  • 1.4.3 is Partially Supports, with responsibility Component. FormHelperText sets text.secondary and error.main itself. One root cause gets one ⚠️, on the component that creates it: the default dark error.main on elevated Paper. The known-gaps table lists it in the palette row.
  • The helper text of a disabled field is exempt from 1.4.3. It is part of an inactive user interface component, in WCAG's words. This is the same position as the TextField report. axe cannot see the link, so the fixtures leave out a disabled field. A disabled FormHelperText with no disabled field is not exempt. The report also advises that helper text which tells why a field is disabled is content the user needs, so it must stay readable.
  • The filled error field in the variants fixture has its visible label. An earlier version hid the label to avoid the known TextField failure (about 4.36:1). The fixture now shows the failure, and color-contrast is not asserted on it.
  • 1.4.1 finding. The CheckboxesGroup docs demo shows "You can display an error" in both states, so the error cue there is color only. This finding moves here from the FormGroup report.
  • 3.3.1 is Hybrid. The test proves the association and aria-invalid on a standalone input. Whether the words name the error is the author's content. The merged TextField report rates 3.3.1 Automated.
  • 2.4.6 and 4.1.2 are Not Applicable. Helper text is neither a label nor a component with a role.

Merge order with the sibling Wave 1 PRs

This is the last open Wave 1 PR. This branch includes master, with the IconButton (#49549), Fab (#49550), ButtonGroup (#49551), FormLabel (#49552), FormGroup (#49554), Link (#49555), and Chip (#49556) PRs. Do not hand-merge the generated blocks: after each merge of master, run pnpm a11y:scorecard.

Not done in this PR

  • The screen-reader checks from the issue have steps and pass conditions in the report. Nobody has run them yet.
  • Follow-up: align TextField 3.3.1 with this report (Hybrid, because the words of the message are the author's content).

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@code-infra-dashboard

code-infra-dashboard Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Deploy preview

Bundle size

Bundle Parsed size Gzip size
@mui/material 0B(0.00%) 0B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Performance

No regressions in 32 benchmarks · precise to ±8.3% (±15.1% at worst) · ran 3m 55s · details


Check out the code infra dashboard for more information about this PR.

michelengelen and others added 2 commits October 29, 2026 15:59
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…conformance

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@siriwatknp siriwatknp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generated output matches pnpm a11y:scorecard on this branch, and also after merging master. The contrast numbers check out too.

Left a few doc fixes inline, and one question about the new known-gap row. #49552 adds the same row, so maybe we can settle it once for both PRs.

@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Nov 26, 2026
michelengelen and others added 2 commits November 26, 2026 14:09
…conformance

Keep both sides in knownGaps.json, where the IconButton PR (mui#49549) also adds rows. Take the lockfile from master. Regenerate the scorecard files with pnpm a11y:scorecard.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Nov 27, 2026
…conformance

Master now has the Link PR (mui#49555). Keep both sides in knownGaps.json. Regenerate the scorecard files with pnpm a11y:scorecard.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@github-actions github-actions Bot added PR: out-of-date The pull request has merge conflicts and can't be merged. and removed PR: out-of-date The pull request has merge conflicts and can't be merged. labels Nov 27, 2026
The known-gaps note for Button names error in dark mode, but the Button report listed only info and warning. Add the dark-mode values to the 1.4.3 gap, section, manual steps, and pass condition. mui#49552 makes the identical edit.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@michelengelen
michelengelen enabled auto-merge (squash) November 27, 2026 09:46
@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Nov 27, 2026
…conformance

Master now has the FormLabel PR (mui#49552). Keep both sides in the files that it also edits. Regenerate the scorecard files with pnpm a11y:scorecard.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@github-actions github-actions Bot added PR: out-of-date The pull request has merge conflicts and can't be merged. and removed PR: out-of-date The pull request has merge conflicts and can't be merged. labels Nov 27, 2026
…conformance

Master now has the Fab PR (mui#49550). Keep both sides in the files that it also edits. Regenerate the scorecard files with pnpm a11y:scorecard.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@github-actions github-actions Bot added PR: out-of-date The pull request has merge conflicts and can't be merged. and removed PR: out-of-date The pull request has merge conflicts and can't be merged. labels Nov 27, 2026
…conformance

Master now has the ButtonGroup PR (mui#49551) and the FormGroup PR (mui#49554). Keep both sides in the files that they also edit. Regenerate the scorecard files with pnpm a11y:scorecard.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Nov 27, 2026
@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Nov 27, 2026
…conformance

Master now contains the Chip report (mui#49556).
Keep the Chip and the FormHelperText enrolment tests.
Regenerate the scorecard files.
Put FormHelperText after Fab in the contrast gap list.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@github-actions github-actions Bot added PR: out-of-date The pull request has merge conflicts and can't be merged. and removed PR: out-of-date The pull request has merge conflicts and can't be merged. labels Nov 27, 2026
…conformance

Master now contains the Chip and Fab report corrections (mui#49934).
Regenerate the scorecard files.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Nov 27, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants