feat(ai-character): 리소스 관리 기반 정비

This commit is contained in:
Yu Sung
2026-08-01 01:30:24 +09:00
parent 55ba0df77a
commit a1cae336d9
73 changed files with 5162 additions and 816 deletions

View File

@@ -40,3 +40,19 @@ test("ResourcePagination disables unavailable previous and next actions", () =>
expect(screen.getByRole("button", { name: "이전 페이지" })).toBeDisabled();
expect(screen.getByRole("button", { name: "다음 페이지" })).toBeDisabled();
});
test("ResourcePagination connects each page size label to a unique select", () => {
const { container } = render(
<>
<ResourcePagination data={pageData} onPageChange={vi.fn()} onSizeChange={vi.fn()} />
<ResourcePagination data={{ ...pageData, page: 0 }} onPageChange={vi.fn()} onSizeChange={vi.fn()} />
</>,
);
const selects = screen.getAllByLabelText("페이지 크기");
const selectIds = selects.map((select) => select.id);
const labels = Array.from(container.querySelectorAll("label"));
expect(new Set(selectIds).size).toBe(selectIds.length);
expect(labels.map((label) => label.control)).toEqual(selects);
});