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.
This commit is contained in:
committed by
GitHub
parent
50f3c961ff
commit
7443b66739
@@ -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 }) => {
|
||||
|
||||
Reference in New Issue
Block a user