diff --git a/canvas/src/components/ConfirmDialog.tsx b/canvas/src/components/ConfirmDialog.tsx index 75cacd70..9e799c5a 100644 --- a/canvas/src/components/ConfirmDialog.tsx +++ b/canvas/src/components/ConfirmDialog.tsx @@ -105,8 +105,12 @@ export function ConfirmDialog({ // (e.g. parents with transform, filter, will-change that break position:fixed). return createPortal(
- {/* Backdrop */} -
+ {/* Backdrop — interactive dismiss area; accessible name for screen readers (WCAG 4.1.2) */} +
{/* Dialog — role="dialog" + aria-modal prevent interaction with background */}
{ expect(onCancel).toHaveBeenCalledTimes(1); }); + it("backdrop has aria-label for screen reader users (WCAG 4.1.2)", () => { + render( + + ); + const backdrop = document.querySelector(".bg-black\\/60"); + expect(backdrop).toBeTruthy(); + expect(backdrop?.getAttribute("aria-label")).toBe("Dismiss dialog"); + }); + it("singleButton: onConfirm fires on button click", () => { const onConfirm = vi.fn(); render(