feat(housekeeping): finish accessible command deck
This commit is contained in:
1 parent
85ad0452d3
commit
a113e48880
55 files changed
+17064
-509
No files matched your search
@@ -11,6 +11,8 @@ describe("HousekeepingPageState", () => {
|
||||
["empty", "status"],
|
||||
["partial", "status"],
|
||||
["error", "alert"],
|
||||
["forbidden", "alert"],
|
||||
["ready", "status"],
|
||||
] as const)("renders %s with the %s role", (state, role) => {
|
||||
const pageState =
|
||||
state === "partial" ? (
|
||||
@@ -34,6 +36,35 @@ describe("HousekeepingPageState", () => {
|
||||
expect(html).toContain(`>${state} description<`);
|
||||
});
|
||||
|
||||
it.each([
|
||||
["loading", "polite"],
|
||||
["empty", "polite"],
|
||||
["partial", "polite"],
|
||||
["error", "assertive"],
|
||||
["forbidden", "assertive"],
|
||||
["ready", "polite"],
|
||||
] as const)("announces %s changes with %s priority", (state, live) => {
|
||||
const pageState =
|
||||
state === "partial" ? (
|
||||
<HousekeepingPageState
|
||||
state="partial"
|
||||
partialLabel="Partial"
|
||||
title={`${state} title`}
|
||||
description={`${state} description`}
|
||||
/>
|
||||
) : (
|
||||
<HousekeepingPageState
|
||||
state={state}
|
||||
title={`${state} title`}
|
||||
description={`${state} description`}
|
||||
/>
|
||||
);
|
||||
const html = renderToStaticMarkup(pageState);
|
||||
|
||||
expect(html).toContain(`data-page-state="${state}"`);
|
||||
expect(html).toContain(`aria-live="${live}"`);
|
||||
});
|
||||
|
||||
it("announces loading politely", () => {
|
||||
const loading = renderToStaticMarkup(
|
||||
<HousekeepingPageState
|
||||
|
||||
Reference in new issue
Block a user