DEV: Add tests for sidebar accessibility changes (#19138)

Accessibility is a feature which we do not want to regress on.

Follow-up to e30df22716
This commit is contained in:
Alan Guo Xiang Tan 2022-11-22 06:07:47 +08:00 committed by GitHub
parent e30df22716
commit e05cd5de8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 0 deletions

View File

@ -195,5 +195,25 @@ acceptance(
"the 3 topic tracking state change callbacks are removed" "the 3 topic tracking state change callbacks are removed"
); );
}); });
test("accessibility of sidebar section header", async function (assert) {
await visit("/");
assert.ok(
exists(
".sidebar-section-community .sidebar-section-header[aria-expanded='true'][aria-controls='sidebar-section-content-community']"
),
"accessibility attributes are set correctly on sidebar section header when section is expanded"
);
await click(".sidebar-section-header");
assert.ok(
exists(
".sidebar-section-community .sidebar-section-header[aria-expanded='false'][aria-controls='sidebar-section-content-community']"
),
"accessibility attributes are set correctly on sidebar section header when section is collapsed"
);
});
} }
); );