-
Notifications
You must be signed in to change notification settings - Fork 33
Test plan for the Switch Example Using HTML Checkbox Input #1290
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
base: master
Are you sure you want to change the base?
Conversation
…h to match the use of `label`
This plan is ready except for one problem: the setAttribute method call for setting aria-checked to 'true' is not working in the scripts for tests 2, 4, 6, and 8. I looked at the js in the generated HTML; it looks good to me. I don't know why setAttribute is not working. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you see why the setAttribute specified on line 26 in this file is not setting aria-checked to 'true'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mcking65 switch-checkbox
is using <input type=checkbox>
which controls it's own checked
attribute. The other, switch
and switch-button
operated differently in being controlled by aria-checked
. I'm thinking the following is what's wanted here:
const switchEl = testPageDocument.querySelector('[role="switch"]');
switchEl.checked = true;
switchEl.setAttribute('aria-checked', 'true');
edit: Going back through the roles guidance on the switch pattern page, thinking the switch-checkbox WAI example could be updated to include aria-checked
to follow that guidance
striking below thought:
Commented aria-checked
in the above snippet because it's not mentioned on the example page. Should it still be part of this setup script and assertions?
…into tests/switch-checkbox
Preview Tests
Preview of Switch Example Using HTML Checkbox Input Test Plan | For Pattern: switch-checkbox