From f08e03de134a005a59f02108f9b91e3fd7a5d191 Mon Sep 17 00:00:00 2001 From: Yun Chan Date: Wed, 12 Aug 2026 17:49:08 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=B8=EC=A6=9D=20E2E=20=EA=B2=A9=EB=A6=AC?= =?UTF-8?q?=EC=84=B1=20=EB=B3=B4=EA=B0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/e2e/full-sweep-auth.spec.ts | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/apps/web/e2e/full-sweep-auth.spec.ts b/apps/web/e2e/full-sweep-auth.spec.ts index 5dea285..219912a 100644 --- a/apps/web/e2e/full-sweep-auth.spec.ts +++ b/apps/web/e2e/full-sweep-auth.spec.ts @@ -110,6 +110,16 @@ async function fulfillConfig(page: Page, body: unknown) { }); } +async function mockUnauthenticatedMe(page: Page) { + await page.route(ME_PATTERN, async (route) => { + await route.fulfill({ + status: 401, + contentType: "application/json", + body: JSON.stringify({ detail: "not_authenticated" }), + }); + }); +} + test.describe("full sweep auth", () => { test.beforeEach(async ({ page }) => { await useRealApi(page); @@ -119,13 +129,7 @@ test.describe("full sweep auth", () => { test("login root follows the narrow document scrollport without horizontal overflow", async ({ page, }) => { - await page.route(ME_PATTERN, async (route) => { - await route.fulfill({ - status: 401, - contentType: "application/json", - body: JSON.stringify({ detail: "not_authenticated" }), - }); - }); + await mockUnauthenticatedMe(page); await fulfillConfig(page, READY_AUTH_CONFIG); await page.setViewportSize({ width: 390, height: 844 }); await page.goto("/login"); @@ -152,13 +156,7 @@ test.describe("full sweep auth", () => { test("secondary Google button shows the second allowed domain and starts the same google OAuth flow", async ({ page, }) => { - await page.route(ME_PATTERN, async (route) => { - await route.fulfill({ - status: 401, - contentType: "application/json", - body: JSON.stringify({ detail: "not_authenticated" }), - }); - }); + await mockUnauthenticatedMe(page); await fulfillConfig(page, READY_AUTH_CONFIG); await page.route("**/api/auth/login**", async (route) => { await route.fulfill({ @@ -194,6 +192,7 @@ test.describe("full sweep auth", () => { test("brand panel domain badges distinguish checking, unset, and loaded states", async ({ page, }) => { + await mockUnauthenticatedMe(page); // 1) 설정 조회가 끝나지 않은 동안: "확인 중" 배지. await page.route(CONFIG_PATTERN, () => { /* 응답을 보류해 조회 중 상태를 고정한다 */