테마 적용
This commit is contained in:
@@ -171,6 +171,56 @@ describe("AllProjectSubmissionsPage - 전체 폼 제출 내역", () => {
|
||||
expect(submissionsLink.closest("a")?.getAttribute("href")).toBe("/projects/submissions");
|
||||
});
|
||||
|
||||
it("전체 제출 내역 테이블은 라이트 테마에서 읽기 쉬운 텍스트 색상을 사용해야 한다", async () => {
|
||||
const submissions = [
|
||||
{
|
||||
id: "1",
|
||||
createdAt: "2025-01-01T12:00:00.000Z",
|
||||
projectSlug: "proj-1",
|
||||
projectTitle: "프로젝트 1",
|
||||
payload: {
|
||||
name: "홍길동",
|
||||
email: "user@example.com",
|
||||
phone: "010-1234-5678",
|
||||
birthdate: "1990-01-01",
|
||||
message: "안녕하세요",
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const fetchMock = vi.fn().mockResolvedValue(
|
||||
new Response(JSON.stringify(submissions), {
|
||||
status: 200,
|
||||
headers: { "Content-Type": "application/json" },
|
||||
}),
|
||||
);
|
||||
|
||||
vi.stubGlobal("fetch", fetchMock as any);
|
||||
|
||||
const { container } = render(<AllProjectSubmissionsPage />);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(fetchMock).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
const headerRow = container.querySelector("thead tr") as HTMLElement | null;
|
||||
expect(headerRow).not.toBeNull();
|
||||
|
||||
const headerClass = headerRow!.className;
|
||||
expect(headerClass).toContain("border-slate-200");
|
||||
expect(headerClass).toContain("text-slate-600");
|
||||
expect(headerClass).toContain("dark:border-slate-800");
|
||||
expect(headerClass).toContain("dark:text-slate-400");
|
||||
|
||||
const nameCellNode = await screen.findByText("홍길동");
|
||||
const nameCell = nameCellNode.closest("td") as HTMLElement | null;
|
||||
expect(nameCell).not.toBeNull();
|
||||
|
||||
const nameClass = nameCell!.className;
|
||||
expect(nameClass).toContain("text-slate-900");
|
||||
expect(nameClass).toContain("dark:text-slate-100");
|
||||
});
|
||||
|
||||
it("GNB에서 현재 페이지인 '전체 제출 내역' 탭에 aria-current=\"page\"가 설정되어야 한다", async () => {
|
||||
const fetchMock = vi.fn().mockResolvedValue(
|
||||
new Response(JSON.stringify([]), {
|
||||
|
||||
Reference in New Issue
Block a user