Skip to content

[test][chip] Add axe tests and WCAG conformance report - #49556

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

michelengelen merged 18 commits into
mui:masterfrom
michelengelen:feature/mat-2028-a11ychip-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 Chip. This is Wave 1, item 10 of #49260. Part of #49414.

Chip

Result Count
✅ Supports 16
⚠️ Partially Supports 7
❌ Does Not Support 1
➖ Not Applicable 31
🚩 Flagged 9/24

Known gaps, each confirmed in a browser or, for 1.1.1, from the source:

  • 1.1.1 Non-text Content. The delete icon tells sighted users that a chip can be deleted. No text gives this information to a screen-reader user.
  • 1.4.3 Contrast (Minimum). info (3.86:1) and warning (3.11:1) labels fail in both variants. On a focused outlined chip, every color except secondary fails (primary 3.93:1, error 4.15:1, success 4.37:1). On a hovered clickable outlined chip, primary is 4.37:1.
  • 1.4.10, 1.4.12. The label does not wrap. A label that fits at 100% ends with an ellipsis at 320 px, or with the WCAG text-spacing values. The same happens under a 200% text-only resize, which the 1.4.4 notes record.
  • 1.4.11 Non-text Contrast (❌ Does Not Support). The delete icon is less than 3:1 in 8 of the 14 color and variant combinations. This includes both default ones: 1.86:1 (filled) and 1.88:1 (outlined). The focused background is 1.61:1 against the page.
  • 2.4.3 Focus Order. The component does not move focus after a deletion. In the ChipsArray demo, a keyboard deletion moves focus to the page body.
  • 2.5.8 Target Size (Minimum). The delete icon is 22 px (medium) or 16 px (small). On a clickable and deletable chip, the spacing exception does not apply.
  • 4.1.2 Name, Role, Value. A disabled delete-only chip gets no aria-disabled, and it stays focusable. A delete-only chip has the button role, but Enter and Space do nothing.

Report: Chip/accessibility.md

Changes

  • Tests. The Chip.test.js "WCAG 2.2 conformance" block covers 1.1.1, 1.4.3, 1.4.11, 2.1.2, 2.4.3, 2.5.2, 2.5.3, 3.2.1, and 4.1.2.
    • The block does not repeat existing tests. The existing keyboard tests now have the title "2.1.1 Keyboard", so the scorecard reads them as evidence.
    • The 1.4.3 tests compare the rendered filled and outlined colors with the palette contrast contract. A third test pins the failing set for a focused outlined chip: all colors except secondary.
    • Two tests pin documented gaps and fail when the gap is fixed:
      • the default delete icon is below 3:1;
      • a disabled delete-only chip has no aria-disabled and stays focusable.
  • axe. All docs demos except ChipsPlayground are enrolled with assertions: 'all', plus four fixtures:
    • ChipA11ySemanticStates and ChipA11yLongLabel assert every rule.
    • ChipA11yColorMatrix and ChipA11yKnownGaps record color-contrast without asserting it. The failures are the info and warning labels, and the faded label of a disabled delete-only chip. axe rates that chip as active, because it has no aria-disabled.
    • AvatarChips asserts every rule. After [chip] Improve default avatar text contrast #49576, the letter avatar passes color-contrast.
  • Playwright.
    • Chip is in the CSS layout suite on ChipsArray, in the 2.4.7 focus-visible suite, and in the theme.focusVisible ring suite. The ring suite proves the focusVisible workaround for Chip.
    • Two tripwire tests on ChipA11yLongLabel expect the truncation at 200% text, with WCAG spacing, and at 320 px. The first also checks that the label has white-space: nowrap, because the spacing step has only about 5 px of margin. They fail when Chip starts to wrap its label.
  • Docs (chips.md). The page no longer says that releasing Escape blurs the Chip; [material-ui][Chip] Fix focus issue related with the Escape event #41578 removed that behavior. It now explains focus after a deletion and skipFocusWhenDisabled.
  • Known gaps. Four new rows. Chip is added to the focus-indicator and palette rows.
  • Scorecard (render.mjs). Chip 1.4.11 is the first ❌ rating in the scorecard.
    • The docs table has a new "❌ Does Not Support" column, so the rating shows in the Chip row.
    • The docs-page headline now uses the singular for one criterion: "1 criterion records a ❌ Does Not Support rating in at least one component."
    • The known-gaps intro now says "Each ⚠️ and ❌ rating comes from one of the issues below."

Decisions for review

  • Page zoom decides 1.4.4 (WCAG technique G142), the rule that [test][fab] Add axe tests and WCAG conformance report #49550 added to the layout suite on master. Under page zoom the label and its container scale together, so 1.4.4 is ✅ · Automated. The layout suite runs the page-zoom check and the text-only check on ChipsArray, and both pass. The report and a Playwright tripwire record the text-only truncation of a long label in a px-wide container.
  • 1.4.11 is ❌ Does Not Support. Most of the functionality fails: the delete icon fails in 8 of the 14 combinations, including both default ones, and the default focus indicator fails.
  • The outlined border does not need 3:1. The label identifies the chip. The Linear issue asked for 3:1. The report records the values and the reason.
  • A disabled delete-only chip is exempt from 1.4.3. After [chip] Prevent keyboard deletion when disabled #49534, Backspace and Delete do nothing on it, so it is an inactive component. axe-core still fails its faded label (2.14:1), because the chip has no aria-disabled. The 4.1.2 gap records this.
  • 2.4.3 is ⚠️ · ◐ Shared. The component does not unmount itself, but it gives no focus handling, and the ChipsArray demo fails. The chips.md note tells authors to move focus.
  • 2.1.1 is 🔁 Hybrid. Unit tests cover the keys, and the manual steps check deletion in the ChipsArray demo.
  • 2.4.7 is ✅ and not flagged, the same as Button. The focused background can be hard to see for some palette colors. The 1.4.11 ❌ and the AAA 2.4.13 note record this.

Merge order with the sibling Wave 1 PRs

This branch includes master, with the IconButton (#49549), Fab (#49550), ButtonGroup (#49551), FormLabel (#49552), FormGroup (#49554), and Link (#49555) PRs. knownGaps.json, demoMeta.ts, criteriaSuites.mjs, KeyboardRing.js, and FOCUS_RING_TARGETS conflict as adjacent insertions with the FormHelperText PR (#49553), where both PRs edit them. Resolve them by keeping both sides. Do not hand-merge the generated blocks: after each rebase, 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. The 1.1.1 result is the expected result from the source.

Follow-ups (tracked in #49477)

  • Component: set aria-disabled on a disabled delete-only chip.
  • Component: make Enter and Space do something on a delete-only chip, or remove its button role.
  • Component: keep the outlined label at 4.5:1 on focus and hover, for example with a darker label in these states.
  • Component: give the delete icon a 24 px target and 3:1 contrast, and expose the delete action to assistive technology.
  • Component: let the label wrap, or offer a prop for it.
  • Demo: move focus after a deletion in ChipsArray.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michelengelen michelengelen added accessibility a11y test scope: chip Changes related to the chip. labels Oct 24, 2026
@michelengelen michelengelen self-assigned this Oct 24, 2026
@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 ±5.8% (±9.4% at worst) · ran 3m 12s · 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>
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 master merge brought in #49534 and #49576, and they make one test and a few claims in the report outdated. I think that's why test_unit, test_browser and test_regressions are red. Details are in the comments.

Comment thread test/regressions/demoMeta.ts Resolved
@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/index.test.js Resolved
Keep both sides in the files that the IconButton PR (mui#49549) 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
Master now has the Link PR (mui#49555). 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 enabled auto-merge (squash) November 27, 2026 10:15
@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
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 removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Nov 27, 2026

@LukasTy LukasTy 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.

Couple of small nits

@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
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 and others added 2 commits November 27, 2026 12:03
Co-authored-by: Lukas Tyla <llukas.tyla@gmail.com>
Signed-off-by: Michel Engelen <32863416+michelengelen@users.noreply.github.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
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
@michelengelen
michelengelen merged commit c33e7f8 into mui:master Nov 27, 2026
23 checks passed
@michelengelen
michelengelen deleted the feature/mat-2028-a11ychip-assess-wcag-22-conformance branch November 27, 2026 13:12
michelengelen added a commit to michelengelen/material-ui that referenced this pull request 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility a11y scope: chip Changes related to the chip. test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants