Repository navigation
[test][FormControlLabel] Add axe tests and WCAG conformance report - #49524
rohits2501 wants to merge 6 commits into
Conversation
b12a769 to
937d877
Compare
Deploy previewBundle size
PerformanceNo regressions in 32 benchmarks · ran 4m 19s · details Check out the code infra dashboard for more information about this PR. |
937d877 to
2bfd08c
Compare
|
Hi @JCQuintas @silviuaavram, could you take a look when you get a chance? |
|
Hey @rohits2501 👋 While reviewing the other Form* reports from Wave 1 (FormLabel #49552, FormHelperText #49553, FormGroup #49554), we noticed the four reports rated the same criteria in different ways. We aligned them on a small set of rules, most of which come straight from the merged reports:
Your report already lines up with almost all of this (3.2.4 N/A, 2.5.8 Shared, and 2.5.3/4.1.2 rated because the
The required state of a group (a required Happy to help with any of this if you'd like! |
Rate 1.1.1 not applicable, since the required asterisk only duplicates the native required state. Rate 1.3.2 as shared, since labelPlacement sets the layout. Add the 1.3.1 unit test the report cites.
|
Thanks @michelengelen, all three are in 0dceb0d.
I left out the FormLabel link for now because #49552 has not merged, so the relative link would point to a missing file. I can add it once that lands. |
Closes #49409
Adds a WCAG 2.2 (Level A/AA) conformance assessment for
FormControlLabel, following the existing component reports. This is an assessment only. No component or theme behavior changes.Scope decision
FormControlLabelwraps aCheckbox,Radio, orSwitch, so it has no single parent to inherit from. The report rates the 14 criteria the label's own text, placement, and association are responsible for, and marks the wrapped control's keyboard, focus, pointer, role, and value behavior Not Applicable, since those are rated in the control reports.What's included
FormControlLabel/accessibility.json(the source of truth) and the generatedaccessibility.md.form-control-labeldocs slug and axe fixtureFormControlLabelA11yStates, enrolled indemoMeta.tswith a matchingdemoMeta.test.tscase, so axe results stay out of the Checkbox, Radio, and Switch slugs.CSS_LAYOUT_SUITESentry with all three layout criteria (1.4.4, 1.4.10, 1.4.12) applying, since the label renders text. It is not added toFOCUS_VISIBLE_TARGETSbecause the label is not focusable.labelPlacement.Findings (the checks in the issue)
<label>root clones the control inside it, so the control's accessible name comes from the visible label text.target-sizepasses.labelPlacementchanges only the visual order.requiredshows a visible asterisk with the native required state.text.primaryand the disabled label (text.disabled) is exempt. axe-corecolor-contrastpasses.No partials or gaps were found, so there is no follow-up fix PR for this component.
Notes
form-control-label.a11y.jsonis generated by the regression harness (pnpm test:regressions), not hand-written.