From 7443b667392db7889b770977ab07853e5c4db7a0 Mon Sep 17 00:00:00 2001 From: "groombook-engineer[bot]" <269742240+groombook-engineer[bot]@users.noreply.github.com> Date: Tue, 31 Mar 2026 16:00:58 +0000 Subject: [PATCH] fix(e2e): remove portal/me mock entirely - not needed for impersonation tests The portal/me endpoint is only called in the client dev user flow (devUser.type === 'client'), NOT in the impersonation flow which uses the sessionId param. Removing this mock eliminates potential interference. --- apps/e2e/tests/impersonation.spec.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/e2e/tests/impersonation.spec.ts b/apps/e2e/tests/impersonation.spec.ts index f58c4b7..ef2f5d8 100644 --- a/apps/e2e/tests/impersonation.spec.ts +++ b/apps/e2e/tests/impersonation.spec.ts @@ -2,7 +2,6 @@ import { test, expect } from "./fixtures.js"; /** * E2E tests for customer portal impersonation flow. - * Tests ImpersonationBanner display, actions, and session management. */ const MOCK_SESSION = { @@ -19,7 +18,7 @@ const MOCK_SESSION = { test.describe("ImpersonationBanner", () => { test.beforeEach(async ({ page }) => { - // Impersonation session endpoints + // Only mock impersonation endpoints - portal/me is NOT called in impersonation flow await page.route("**/api/impersonation/sessions/session-1", (route) => route.fulfill({ json: MOCK_SESSION }) ); @@ -32,10 +31,8 @@ test.describe("ImpersonationBanner", () => { await page.route("**/api/impersonation/sessions/session-1/audit-log", (route) => route.fulfill({ json: { logs: [] } }) ); - // Portal profile endpoint used during impersonation - await page.route("**/api/portal/me**", (route) => - route.fulfill({ json: { id: "client-1", name: "Carol Client", email: "carol@test.com" } }) - ); + // NOTE: NOT mocking portal/me - this endpoint is only called in the CLIENT + // dev user flow (devUser.type === "client"), NOT in the impersonation flow }); test("banner displays when session is active", async ({ page }) => {