Skip to content

Issue/1745#1903

Open
MaryamMehd wants to merge 17 commits intomainfrom
issue/1745
Open

Issue/1745#1903
MaryamMehd wants to merge 17 commits intomainfrom
issue/1745

Conversation

@MaryamMehd
Copy link
Copy Markdown
Collaborator

Adds AccessibleFeedback wrapper around error/feedback messages so screen readers announce them as WCAG 2.1 SC 4.1.3 status messages.

Also fixes a CI Storybook test selector that had an incorrect colon removal — reverted to match the component's actual data-test attribute.

Closes #1745

Sean Fong and others added 17 commits March 5, 2026 14:37
- Created AccessibilityErrors.stories.tsx with 3 test stories
- Tests verify role='alert' and aria-live='assertive' attributes
- Covers String (regex), Integer (minValue), and Text (maxLength) validations
- All tests manually verified with VoiceOver on macOS
- Errors are announced dynamically without focus change

Related to #1745
Apply role='alert' and aria-live='assertive' via slotProps.formHelperText instead of wrapping in AccessibleFeedback component. This ensures the ARIA attributes are on the MUI FormHelperText element that tests query for, fixing the failing AccessibilityErrors Storybook tests.
Change test assertion from 'does not match' to 'should match' to align with the actual regex validation error message: 'Input should match the specified regex'.
… components

- Replace slotProps.formHelperText with helperText={<AccessibleFeedback>{feedback}</AccessibleFeedback>}
- Apply to StringField, IntegerField, and TextField to fix Storybook test failures
- MUI's FormHelperText doesn't forward custom role/aria-live props, so we use the wrapper component
- VoiceOver confirmed to announce error messages properly

Fixes #1745 Storybook test failures
…s tests

- Replace conditional if(alertElement) with expect(alertElement).not.toBeNull()
- Prevents silent test passes and timeout errors
- Ensures tests fail properly if error element is not found

This fixes the timeout errors in AccessibilityErrors.stories.tsx Storybook tests.
- Wrap error messages with AccessibleFeedback component using role='alert' and aria-live='assertive'
- Apply to StringField, IntegerField, and TextField components
- Add StyledRequiredTypography export alias for backward compatibility
- Update AccessibilityErrors tests to verify ARIA attributes
- Remove unused state variables in OpenChoiceAutocompleteField
- Ensure error messages are announced by screen readers per WCAG 2.1 SC 4.1.3
- Replace getByTestId() with querySelector for data-test attribute in Decimal, Integer, and Quantity tests
- Add findByLinkIdOrLabel import to Quantity.stories.tsx
- Add null checks for Clear button in Decimal and Integer basic tests to prevent test failures
- All 188 Storybook tests now passing
- Remove unused AccessibleFeedback imports from Choice and OpenChoice components
- Remove unused 'within' import from Decimal, Integer, and Quantity test files
Merge latest main into issue/1745 and resolve conflicts in choice value-set selection fields, preserving placeholder behavior and delayed dropdown opening for accessibility.

Made-with: Cursor
…bute

The checkRadioOption call was passing 'Other, please specify:' (with a trailing
colon) but ChoiceRadioSingle sets data-test using the raw label prop which has
no colon - the colon is only added visually via styledLabel. Removing the colon
aligns the test selector with the actual attribute value.

Made-with: Cursor
RadioButtonWithOpenLabel passes label + ':' to ChoiceRadioSingle, so the
data-test attribute is 'radio-single-Other, please specify:'. The colon
in the test selector is required to match.

Made-with: Cursor
Accept main's conditional aria-label/aria-describedby pattern in
DecimalField and QuantityField, and main's corrected clear button
selector (title="Clear") in Integer.stories.

Made-with: Cursor
Remove unused 'Await' import from react-router-dom in
aboriginalFormCompletedFor49To25Years and aboriginalFormCompletedFor51Years.
These files were brought in via merge from main.

Made-with: Cursor
@MaryamMehd MaryamMehd requested a review from clinnygee May 1, 2026 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error Status Messages (accessibility)

2 participants