-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: ToHaveAccesssibleErrorMessage does not work with group of inputs #34612
Comments
@MattyBalaam Could you please explain why should this
Is there any spec/document/explainer that shows how and why error message should be used with groups/fieldsets? |
This is interesting, I have historically used this because I know that testing-library respects this usage of this pattern with role="group", and it is something that a lot of guides online recommend to use for a group of elements. e.g. https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/ I have tested with "radiogroup" role instead and that works with the error id it appears, but if I try to make a set of checkboxes it does not. When I look at a large library, I see that react-aria for example instead used aria-describedby for their checkbox group: https://react-spectrum.adobe.com/react-aria/useCheckboxGroup.html#group-validation. I have also been able to foree the matter and use the role "checkbox" for this group of checkboxes, but I don’t think that would be correct? Basically I am confused now about the best way to show these error messages. Perhaps this case of a group of checkboxes is something that has fallen through the cracks of standards. The |
You are not alone! It seems like many vendors have only shipped support for aria-errormessage in 2024, and there are still discrepancies between browsers and assistive software.
Instead of |
Closing as there is no action item for Playwright here. If you think there is something to improve, please file a new issue and link to this one. |
Version
1.50.1
Steps to reproduce
We use component tests, which probably allows me to illustrate the code that is the edge case.
Standard inputs work very well with accessible error message, but grouped fields do not
Expected behavior
Grouped inputs should work: https://www.w3.org/WAI/tutorials/forms/grouping/
Actual behavior
Additional context
New issue based on work released here: #31249
Environment
npx envinfo --preset playwright sh: /Users/*******/node_modules/.bin/envinfo: Permission denied
The text was updated successfully, but these errors were encountered: