diff --git a/packages/calcite-components/src/components/button/button.e2e.ts b/packages/calcite-components/src/components/button/button.e2e.ts index 81007d13b35..2dd23fa7df8 100644 --- a/packages/calcite-components/src/components/button/button.e2e.ts +++ b/packages/calcite-components/src/components/button/button.e2e.ts @@ -143,6 +143,13 @@ describe("calcite-button", () => { disabled("calcite-button"); }); + it("should have aria-live attribute set to polite by default", async () => { + const page = await newE2EPage(); + await page.setContent(`Continue`); + const button = await page.find("calcite-button >>> button"); + expect(button.getAttribute("aria-live")).toBe("polite"); + }); + it("should update childElType when href changes", async () => { const page = await newE2EPage({ html: `Continue` }); const link = await page.find("calcite-button"); diff --git a/packages/calcite-components/src/components/button/button.tsx b/packages/calcite-components/src/components/button/button.tsx index 664b494323e..325e5cc8311 100644 --- a/packages/calcite-components/src/components/button/button.tsx +++ b/packages/calcite-components/src/components/button/button.tsx @@ -257,7 +257,8 @@ export class Button return ( { describe("translation support", () => { t9n("calcite-card"); }); + + it("should have aria-live attribute set to polite on loader container when loading", async () => { + const page = await newE2EPage(); + await page.setContent(` + + Test image + + `); + + const loaderContainer = await page.find("calcite-card >>> .calcite-card-loader-container"); + expect(loaderContainer.getAttribute("aria-live")).toBe("polite"); + }); }); diff --git a/packages/calcite-components/src/components/card/card.tsx b/packages/calcite-components/src/components/card/card.tsx index 9e0c0fe8f8e..05e07f6c054 100644 --- a/packages/calcite-components/src/components/card/card.tsx +++ b/packages/calcite-components/src/components/card/card.tsx @@ -130,7 +130,7 @@ export class Card implements ConditionalSlotComponent, LocalizedComponent, T9nCo return (
{this.loading ? ( -
+
) : null}