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 <noreply@paperclip.ing>
This commit is contained in:
Barcode Betty
2026-04-15 11:13:21 +00:00
parent 271406de9e
commit 3a67b26e1f
+10
View File
@@ -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 };