diff --git a/src/presentation/design-system/patterns/common-patterns.tsx b/src/presentation/design-system/patterns/common-patterns.tsx index e37e1e91..c9843dce 100644 --- a/src/presentation/design-system/patterns/common-patterns.tsx +++ b/src/presentation/design-system/patterns/common-patterns.tsx @@ -27,11 +27,17 @@ export function DataTable({ rowKey(row: Row): string; empty: React.ReactNode; }>) { + const captionId = useId(); if (rows.length === 0) return <>{empty}; return ( -
+
- + {columns.map((column) => ( diff --git a/tests/component/design-system-platform.test.tsx b/tests/component/design-system-platform.test.tsx index 7a228c8e..ef11d35c 100644 --- a/tests/component/design-system-platform.test.tsx +++ b/tests/component/design-system-platform.test.tsx @@ -326,6 +326,12 @@ describe("design-system platform interactions", () => { expect(screen.getByRole("table", { name: "결과" })).toHaveTextContent( "첫 항목", ); + // UI-08: the keyboard-scrollable wrapper is a named region, not an + // anonymous focus stop. + expect(screen.getByRole("region", { name: "결과" })).toHaveAttribute( + "tabindex", + "0", + ); await user.click(screen.getByRole("link", { name: "2페이지" })); expect(onPage).toHaveBeenCalledWith(2); });
{caption}{caption}