diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 53b45bf..d8ec98b 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -5,8 +5,9 @@ // Try Prisma Accelerate: https://pris.ly/cli/accelerate-init generator client { - provider = "prisma-client" - output = "../src/generated/prisma" + provider = "prisma-client" + output = "../src/generated/prisma" + binaryTargets = ["native", "linux-musl-arm64-openssl-3.0.x"] } datasource db { diff --git a/tests/e2e/editor.spec.ts b/tests/e2e/editor.spec.ts index 837261f..9f2a54d 100644 --- a/tests/e2e/editor.spec.ts +++ b/tests/e2e/editor.spec.ts @@ -2,6 +2,18 @@ import { test, expect } from "@playwright/test"; // 최초에는 실패하는 테스트: /editor 페이지와 헤더 텍스트가 아직 없음 +// 에디터 E2E에서는 인증된 사용자 시나리오를 기본으로 가정한다. +// /api/auth/me 를 항상 200 으로 목 처리해, auth 가드가 /login 으로 리다이렉트하지 않도록 한다. +test.beforeEach(async ({ page }) => { + await page.route("**/api/auth/me", async (route) => { + await route.fulfill({ + status: 200, + contentType: "application/json", + body: JSON.stringify({ id: "user-e2e", email: "e2e@example.com", tokenVersion: 1 }), + }); + }); +}); + test("/editor 페이지가 존재하고 Page Editor 헤더를 보여줘야 한다", async ({ page }) => { await page.goto("/editor"); diff --git a/tests/e2e/preview.spec.ts b/tests/e2e/preview.spec.ts index 8ba1a6a..e3bf35e 100644 --- a/tests/e2e/preview.spec.ts +++ b/tests/e2e/preview.spec.ts @@ -2,6 +2,18 @@ import { test, expect } from "@playwright/test"; // 프리뷰/뷰 모드 TDD: 먼저 실패하는 E2E부터 작성한다. +// 프리뷰 E2E에서도 기본적으로 로그인된 사용자를 가정한다. +// /editor 와 /preview 모두 auth 가드가 /api/auth/me 를 호출하므로, 200 으로 목 처리해 리다이렉트를 막는다. +test.beforeEach(async ({ page }) => { + await page.route("**/api/auth/me", async (route) => { + await route.fulfill({ + status: 200, + contentType: "application/json", + body: JSON.stringify({ id: "user-e2e", email: "e2e@example.com", tokenVersion: 1 }), + }); + }); +}); + test("/preview 페이지는 에디터 크롬 없이 컨텐츠만 보여야 한다", async ({ page }) => { // 프리뷰 페이지로 이동한다. await page.goto("/preview"); diff --git a/uploads/142749ec-f587-4b17-9a95-9fc152848118 b/uploads/142749ec-f587-4b17-9a95-9fc152848118 new file mode 100644 index 0000000..b9954d9 --- /dev/null +++ b/uploads/142749ec-f587-4b17-9a95-9fc152848118 @@ -0,0 +1 @@ +PNG TEST FIXTURE diff --git a/uploads/283eba91-da95-4d18-b7bc-9eb79063d8fd b/uploads/283eba91-da95-4d18-b7bc-9eb79063d8fd new file mode 100644 index 0000000..87ccacf --- /dev/null +++ b/uploads/283eba91-da95-4d18-b7bc-9eb79063d8fd @@ -0,0 +1 @@ +dummy-video \ No newline at end of file diff --git a/uploads/52f8ec96-0daa-488f-a4d0-9dee6718591a b/uploads/52f8ec96-0daa-488f-a4d0-9dee6718591a new file mode 100644 index 0000000..b9954d9 --- /dev/null +++ b/uploads/52f8ec96-0daa-488f-a4d0-9dee6718591a @@ -0,0 +1 @@ +PNG TEST FIXTURE diff --git a/uploads/531e9c25-dea2-4176-b03e-c28e6d53f9be b/uploads/531e9c25-dea2-4176-b03e-c28e6d53f9be new file mode 100644 index 0000000..b9954d9 --- /dev/null +++ b/uploads/531e9c25-dea2-4176-b03e-c28e6d53f9be @@ -0,0 +1 @@ +PNG TEST FIXTURE diff --git a/uploads/6c5819c6-61ea-4adf-aa5f-2c100d9205c7 b/uploads/6c5819c6-61ea-4adf-aa5f-2c100d9205c7 new file mode 100644 index 0000000..b9954d9 --- /dev/null +++ b/uploads/6c5819c6-61ea-4adf-aa5f-2c100d9205c7 @@ -0,0 +1 @@ +PNG TEST FIXTURE diff --git a/uploads/89236ad8-bcee-4f97-8fec-a85305d96f28 b/uploads/89236ad8-bcee-4f97-8fec-a85305d96f28 new file mode 100644 index 0000000..b9954d9 --- /dev/null +++ b/uploads/89236ad8-bcee-4f97-8fec-a85305d96f28 @@ -0,0 +1 @@ +PNG TEST FIXTURE diff --git a/uploads/8c68bb70-4752-47a4-9e5c-3e79080db489 b/uploads/8c68bb70-4752-47a4-9e5c-3e79080db489 new file mode 100644 index 0000000..b9954d9 --- /dev/null +++ b/uploads/8c68bb70-4752-47a4-9e5c-3e79080db489 @@ -0,0 +1 @@ +PNG TEST FIXTURE diff --git a/uploads/91d62d70-2dcc-458e-8b6d-0702dde58062 b/uploads/91d62d70-2dcc-458e-8b6d-0702dde58062 new file mode 100644 index 0000000..b9954d9 --- /dev/null +++ b/uploads/91d62d70-2dcc-458e-8b6d-0702dde58062 @@ -0,0 +1 @@ +PNG TEST FIXTURE diff --git a/uploads/ac7ca5f4-68c5-4365-8ec1-2c682f91bca5 b/uploads/ac7ca5f4-68c5-4365-8ec1-2c682f91bca5 new file mode 100644 index 0000000..b9954d9 --- /dev/null +++ b/uploads/ac7ca5f4-68c5-4365-8ec1-2c682f91bca5 @@ -0,0 +1 @@ +PNG TEST FIXTURE diff --git a/uploads/bb7b1024-953b-4d7c-b723-171d3b699f8b b/uploads/bb7b1024-953b-4d7c-b723-171d3b699f8b new file mode 100644 index 0000000..b9954d9 --- /dev/null +++ b/uploads/bb7b1024-953b-4d7c-b723-171d3b699f8b @@ -0,0 +1 @@ +PNG TEST FIXTURE diff --git a/uploads/c154d1f9-8ab5-4257-ab06-9f0231ff56b9 b/uploads/c154d1f9-8ab5-4257-ab06-9f0231ff56b9 new file mode 100644 index 0000000..b9954d9 --- /dev/null +++ b/uploads/c154d1f9-8ab5-4257-ab06-9f0231ff56b9 @@ -0,0 +1 @@ +PNG TEST FIXTURE diff --git a/uploads/test-image-1764514332240 b/uploads/test-image-1764514332240 new file mode 100644 index 0000000..0cc5db2 --- /dev/null +++ b/uploads/test-image-1764514332240 @@ -0,0 +1 @@ +dummy-image \ No newline at end of file diff --git a/uploads/test-section-bg-1764514332263 b/uploads/test-section-bg-1764514332263 new file mode 100644 index 0000000..0cc5db2 --- /dev/null +++ b/uploads/test-section-bg-1764514332263 @@ -0,0 +1 @@ +dummy-image \ No newline at end of file diff --git a/uploads/test-section-bg-video-1764514332309 b/uploads/test-section-bg-video-1764514332309 new file mode 100644 index 0000000..badc796 --- /dev/null +++ b/uploads/test-section-bg-video-1764514332309 @@ -0,0 +1 @@ +dummy-section-video \ No newline at end of file diff --git a/uploads/test-video-1764514332302 b/uploads/test-video-1764514332302 new file mode 100644 index 0000000..87ccacf --- /dev/null +++ b/uploads/test-video-1764514332302 @@ -0,0 +1 @@ +dummy-video \ No newline at end of file diff --git a/uploads/test-video-poster-1764514332249 b/uploads/test-video-poster-1764514332249 new file mode 100644 index 0000000..7285c92 --- /dev/null +++ b/uploads/test-video-poster-1764514332249 @@ -0,0 +1 @@ +dummy-poster \ No newline at end of file