From a0ac72f7255170966224ce191c0a169bf39a8f0d Mon Sep 17 00:00:00 2001 From: Hongming Wang Date: Thu, 23 Apr 2026 15:37:23 -0700 Subject: [PATCH] test(canvas): update a11y tests for T3 default tier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CreateWorkspaceDialog.a11y.test.tsx's two tier-button tests assumed T1 was the default selection. After the previous commit flipped the non-SaaS default to T3, the radio group's default-selected button changed accordingly. Updated: - "tier buttons have role=radio and aria-checked reflects selection" — T3 is now `aria-checked="true"`, T1 is the "unselected" foil we click to verify the flip. - "selected radio has tabIndex=0, others have tabIndex=-1" — T3 is the tabindex=0 member now. The roving-tabIndex and ArrowDown / ArrowRight tests further down the file start by explicitly clicking/focusing T1 or T2, so they're unaffected by the default change. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../CreateWorkspaceDialog.a11y.test.tsx | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/canvas/src/components/__tests__/CreateWorkspaceDialog.a11y.test.tsx b/canvas/src/components/__tests__/CreateWorkspaceDialog.a11y.test.tsx index d370a9cc..e61f7cf6 100644 --- a/canvas/src/components/__tests__/CreateWorkspaceDialog.a11y.test.tsx +++ b/canvas/src/components/__tests__/CreateWorkspaceDialog.a11y.test.tsx @@ -80,15 +80,16 @@ describe("CreateWorkspaceDialog — accessibility", () => { // Non-SaaS build (jsdom hostname is localhost) shows all four tiers: // T1 Sandboxed, T2 Standard, T3 Privileged, T4 Full Access. expect(radios.length).toBe(4); - // T1 is default selection + // T3 is the default selection on non-SaaS hosts (see + // CreateWorkspaceDialog.tsx `defaultTier` comment). const t1 = radios.find((r) => r.textContent?.includes("T1")); - const t2 = radios.find((r) => r.textContent?.includes("T2")); - expect(t1?.getAttribute("aria-checked")).toBe("true"); - expect(t2?.getAttribute("aria-checked")).toBe("false"); - // Click T2 and verify aria-checked flips - fireEvent.click(t2!); + const t3 = radios.find((r) => r.textContent?.includes("T3")); + expect(t3?.getAttribute("aria-checked")).toBe("true"); + expect(t1?.getAttribute("aria-checked")).toBe("false"); + // Click T1 and verify aria-checked flips + fireEvent.click(t1!); await waitFor(() => - expect(t2?.getAttribute("aria-checked")).toBe("true") + expect(t1?.getAttribute("aria-checked")).toBe("true") ); }); @@ -101,10 +102,10 @@ describe("CreateWorkspaceDialog — accessibility", () => { const t2 = radios.find((r) => r.textContent?.includes("T2"))!; const t3 = radios.find((r) => r.textContent?.includes("T3"))!; const t4 = radios.find((r) => r.textContent?.includes("T4"))!; - // T1 is default selected (non-SaaS test env; SaaS would default to T4) - expect(t1.getAttribute("tabindex")).toBe("0"); + // T3 is default selected (non-SaaS test env; SaaS would default to T4). + expect(t3.getAttribute("tabindex")).toBe("0"); + expect(t1.getAttribute("tabindex")).toBe("-1"); expect(t2.getAttribute("tabindex")).toBe("-1"); - expect(t3.getAttribute("tabindex")).toBe("-1"); expect(t4.getAttribute("tabindex")).toBe("-1"); });