A11Y: "more" nav link should use aria-expanded (#23613)

This commit is contained in:
Kris 2023-09-15 11:27:02 -04:00 committed by GitHub
parent aa9510a731
commit 1d14474e1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -8,6 +8,7 @@
@action={{this.toggleSectionLinks}}
@label="sidebar.more"
class="btn-flat sidebar-more-section-links-details-summary"
aria-expanded={{if this.open "true" "false"}}
/>
</li>

View File

@ -60,6 +60,13 @@ acceptance("Sidebar - Logged on user - Community Section", function (needs) {
"additional section links are displayed"
);
assert.ok(
exists(
".sidebar-section[data-section-name='community'] .sidebar-more-section-links-details-summary[aria-expanded='true']"
),
"aria-expanded toggles to true when additional links are displayed"
);
await click(
".sidebar-section[data-section-name='community'] .sidebar-more-section-links-details-summary"
);
@ -83,6 +90,13 @@ acceptance("Sidebar - Logged on user - Community Section", function (needs) {
),
"additional section links are hidden when clicking outside"
);
assert.ok(
exists(
".sidebar-section[data-section-name='community'] .sidebar-more-section-links-details-summary[aria-expanded='false']"
),
"aria-expanded toggles to false when additional links are hidden"
);
});
test("clicking on everything link", async function (assert) {