feat(ai-character): 리소스 관리 기반 정비
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user