Skip to content

[test][form group] Add axe tests and WCAG conformance report - #49554

Merged
michelengelen merged 13 commits into
mui:masterfrom
michelengelen:feature/mat-2026-a11yformgroup-assess-wcag-22-conformance
Nov 27, 2026
Merged

michelengelen merged 13 commits into
mui:masterfrom
michelengelen:feature/mat-2026-a11yformgroup-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 FormGroup. This is Wave 1, item 8 of #49260. Part of #49412.

FormGroup

Result Count
✅ Supports 7
⚠️ Partially Supports 0
❌ Does Not Support 0
➖ Not Applicable 48
🚩 Flagged 3/7

FormGroup renders a div with no role. Its group semantics come from a fieldset with a legend, or from role="group" with a name. The docs show only the fieldset pattern. No docs page or demo documents role="group" on FormGroup. Every rated criterion is ✅ · ◐ Shared, and the report states what the author must add.

Report: FormGroup/accessibility.md

Rating decisions

The report rates a criterion only when FormGroup's own output governs it:

  • Layout. FormGroup sets the flex layout and flex-wrap, so it rates 1.3.2, 1.4.10, and 2.4.3.
  • Group. With role="group" and a name, FormGroup is the named group element, so it rates 1.3.1, 2.4.6, and 3.3.2.
  • Text. FormGroup renders no text of its own, so 1.4.3, 1.4.4, 1.4.5, and 1.4.12 are not applicable. The CSS layout suite skips 1.4.4 and 1.4.12 for FormGroup.
  • Color. FormGroup gets the error class, but no error style, so 1.4.1 is not applicable.
  • 4.1.2. FormGroup is a container, not a user interface component, so 4.1.2 is not applicable. With role="group", the role and name of the group are rated under 1.3.1.
  • One root cause, one gap. The required state of a group is the FormLabel 1.3.1 gap. The 3.3.2 entry links to the FormLabel report.

Changes

  • Tests. A test is evidence only if it fails when FormGroup's own output regresses. The "WCAG 2.2 conformance" block in FormGroup.test.js has two tests:
    • 1.3.1: role="group" with aria-labelledby gives a named group. This fails if FormGroup stops passing props to its root.
    • 2.4.3: in the browser test projects only, a row group shows its controls from left to right in tab order.
    • One test outside this block has no criterion number in its title: "renders no role of its own".
  • axe. FormGroup has no docs page of its own. The Checkbox page documents it, so one fixture, FormGroupA11yStates, records its results into checkboxes.a11y.json. This is the axeDemos pattern of [test] Count only a component's own demos when axe results are shared #49526:
    • FormGroup/accessibility.json names the fixture in axeDemos.
    • Checkbox/accessibility.json gets an axeDemos list of the nine checkbox demos, so its report does not change.
    • The fixture asserts every rule. It covers a legend, row, an error group, role="group", an unnamed group, and a wide row.
  • Playwright. FormGroup is in the CSS layout suite on its fixture, with skipCriteria: ['1.4.4', '1.4.12']. The five-checkbox row wraps at 320 px.
  • Demos. The checkbox and switch FormControlLabelPosition demos no longer set aria-label="position" on a FormGroup with no role. ARIA does not allow this, and the fieldset legend already names the group.

Findings recorded in the report

  • 3.3.2. The demo survey covers the checkbox, switch, app bar, list, focus-visible, Popper, and CRUD dashboard demos.
    • With a group label: CheckboxesGroup, SwitchesGroup, both FormControlLabelPosition demos, and FocusVisibleCustomIcons.
    • No group label, but each control is a separate option with its own label: CheckboxLabels, SwitchLabels, CustomizedSwitches, MenuAppBar, InteractiveList, and FullFocusVisibleDemo.
    • EmployeeForm uses FormGroup as a layout wrapper for the whole form. Each field has its own label.
  • 1.3.1.
    • ScrollPlayground puts a Typography heading inside each FormGroup. Nothing connects the heading to the group, so the group has no name.
    • FormControl does not connect a FormHelperText to the group.
    • In the error state, the checkboxes get no aria-invalid.

Merge order with the sibling Wave 1 PRs

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.
  • The CheckboxesGroup "You can display an error" helper text is a FormHelperText finding. The FormHelperText report records it.

Follow-ups (tracked in #49477)

  • Docs: checkboxes.md and switches.md should say that a group needs a fieldset and legend, or role="group" with a name. Document the role="group" pattern on FormGroup.
  • Demos: connect the group headings in ScrollPlayground to their groups.

🤖 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 ±10.3% (±16.5% at worst) · ran 4m 14s · 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>
…rmance

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 files are in sync. pnpm a11y:scorecard:check passes on this branch and on a test merge with latest master.

Left a few comments on the 1.3.1 demo note, two tests that can't fail because of FormGroup, and the 4.1.2 wording.

@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
Comment thread test/regressions/demoMeta.ts Resolved
…rmance

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
@michelengelen
michelengelen enabled auto-merge (squash) November 27, 2026 08:54
…rmance

Master now has the Link PR (mui#49555). The text merge has no conflict, but it leaves scorecard.json out of date. Regenerate it with pnpm a11y:scorecard.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@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
…rmance

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
…rmance

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 removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Nov 27, 2026
@michelengelen
michelengelen merged commit 883cb89 into mui:master Nov 27, 2026
23 checks passed
@michelengelen
michelengelen deleted the feature/mat-2026-a11yformgroup-assess-wcag-22-conformance branch November 27, 2026 11:20
michelengelen added a commit to michelengelen/material-ui that referenced this pull request 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>
michelengelen added a commit to michelengelen/material-ui that referenced this pull request Nov 27, 2026
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>
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.

3 participants