사용자 로그인, 가입 처리
CI / test (push) Successful in 3m40s
CI / pr_and_merge (push) Successful in 1m8s

This commit is contained in:
2025-11-30 23:08:38 +09:00
parent 25162e4c12
commit 64e4a59244
82 changed files with 2817 additions and 28 deletions
+19 -2
View File
@@ -52,6 +52,15 @@ vi.mock("next/link", () => {
};
});
vi.mock("next/navigation", () => {
return {
__esModule: true,
useRouter: () => ({
push: vi.fn(),
}),
};
});
describe("PreviewPage - ZIP Export", () => {
it("프리뷰 헤더에 프로젝트 목록 링크가 노출되고 /projects 로 연결되어야 한다", () => {
render(<PreviewPage />);
@@ -83,10 +92,18 @@ describe("PreviewPage - ZIP Export", () => {
fireEvent.click(exportButton);
await waitFor(() => {
expect(fetchMock).toHaveBeenCalledTimes(1);
expect(
fetchMock.mock.calls.some(
([url, options]: any[]) => url === "/api/export" && options?.method === "POST",
),
).toBe(true);
});
const [url, options] = fetchMock.mock.calls[0] as any;
const exportCall = fetchMock.mock.calls.find(
([url, options]: any[]) => url === "/api/export" && options?.method === "POST",
) as any;
const [url, options] = exportCall;
expect(url).toBe("/api/export");
expect(options.method).toBe("POST");
expect(options.headers["Content-Type"]).toBe("application/json");