From 3a67b26e1f459e36e2be55ed10c71ef560940db8 Mon Sep 17 00:00:00 2001 From: Barcode Betty Date: Wed, 15 Apr 2026 11:13:21 +0000 Subject: [PATCH] fix(e2e): add mock for /auth/session endpoint The J8 test calls /api/auth/session which maps to /auth/session in Better Auth. Adding mock to ensure consistent behavior. Co-Authored-By: Paperclip --- e2e/fixtures.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/e2e/fixtures.ts b/e2e/fixtures.ts index 3bdf260..409411c 100644 --- a/e2e/fixtures.ts +++ b/e2e/fixtures.ts @@ -86,4 +86,14 @@ function mockAuthRoutes(page: Page, authenticated = false) { }); } +export function mockSessionPending(page: Page) { + page.route(/.*\/auth\/session.*/, async (route) => { + await route.fulfill({ + status: 401, + contentType: "application/json", + body: JSON.stringify({ error: "Unauthorized" }), + }); + }); +} + export { mockAuthRoutes };