forked from cartsnitch/cartsnitch
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:
@@ -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 };
|
export { mockAuthRoutes };
|
||||||
|
|||||||
Reference in New Issue
Block a user