diff --git a/canvas/src/components/__tests__/ContextMenu.keyboard.test.tsx b/canvas/src/components/__tests__/ContextMenu.keyboard.test.tsx index 07d85489..afdeaf43 100644 --- a/canvas/src/components/__tests__/ContextMenu.keyboard.test.tsx +++ b/canvas/src/components/__tests__/ContextMenu.keyboard.test.tsx @@ -240,7 +240,11 @@ describe("ContextMenu — keyboard accessibility", () => { render(); const items = screen.getAllByRole("menuitem"); const labels = items.map((el) => el.textContent?.trim() ?? ""); - expect(labels).not.toContain(expect.stringMatching(/Expand to Team/)); + // Literal absence — vitest's toContain uses Object.is/===, so the + // earlier `.not.toContain(expect.stringMatching(...))` shape passed + // for ANY string array (asymmetric matchers only work with toEqual / + // arrayContaining). Pin the production string verbatim. + expect(labels.some((l) => l.includes("Expand to Team"))).toBe(false); // Sanity: childless menu still has the regular actions. expect(labels.some((l) => l.includes("Delete"))).toBe(true); expect(labels.some((l) => l.includes("Restart"))).toBe(true);