Skip to content

Conversation

@IsaDC
Copy link
Contributor

@IsaDC IsaDC commented Aug 25, 2025

@IsaDC IsaDC requested a review from mcking65 August 25, 2025 22:37
@IsaDC IsaDC self-assigned this Aug 25, 2025
@IsaDC IsaDC changed the title Thest plan for the Switch Example Using HTML Checkbox Input Test plan for the Switch Example Using HTML Checkbox Input Aug 25, 2025
@mcking65
Copy link
Contributor

@IsaDC

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@howard-e

Do you see why the setAttribute specified on line 26 in this file is not setting aria-checked to 'true'?

Copy link
Contributor

@howard-e howard-e Sep 2, 2025

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?

@IsaDC
Copy link
Contributor Author

IsaDC commented Oct 6, 2025

Hello @mcking65 and @howard-e
I've run into an issue with the automated checks.

First, I merged the latest from master into this branch. I then tried to add the checked HTML attribute, and while there were no local validation issues, the build failed. The error log seems to point to a problem in support.json.

Any ideas what might be causing this?

@howard-e
Copy link
Contributor

howard-e commented Oct 6, 2025

@IsaDC the error was reporting unexpected whitespace in the support.json. I just merged #1309 into master so merging master into this branch again will address that.

@IsaDC
Copy link
Contributor Author

IsaDC commented Oct 6, 2025

Thanks much @howard-e

@IsaDC IsaDC merged commit 7170ce1 into master Oct 6, 2025
10 checks passed
@IsaDC IsaDC deleted the tests/switch-checkbox branch October 6, 2025 22:33
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.

4 participants