From b6da52fb078ddf3c74b3073f4ff7233436637be3 Mon Sep 17 00:00:00 2001 From: Barcode Betty Date: Wed, 15 Apr 2026 11:06:19 +0000 Subject: [PATCH] fix(e2e): correct Better Auth mock response formats - sign-up returns { token, user } - sign-in returns { redirect, token, user } - get-session returns { session, user } Co-Authored-By: Paperclip --- e2e/fixtures.ts | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/e2e/fixtures.ts b/e2e/fixtures.ts index 8936561..3bdf260 100644 --- a/e2e/fixtures.ts +++ b/e2e/fixtures.ts @@ -20,6 +20,7 @@ function mockAuthRoutes(page: Page, authenticated = false) { status: 200, contentType: "application/json", body: JSON.stringify({ + token: null, user: { id: MOCK_USER_ID, email: "mock@cartsnitch.test", @@ -28,15 +29,6 @@ function mockAuthRoutes(page: Page, authenticated = false) { createdAt: new Date().toISOString(), updatedAt: new Date().toISOString(), }, - session: { - id: MOCK_SESSION_ID, - userId: MOCK_USER_ID, - expiresAt: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString(), - createdAt: new Date().toISOString(), - updatedAt: new Date().toISOString(), - ipAddress: null, - userAgent: null, - }, }), }); }); @@ -46,6 +38,8 @@ function mockAuthRoutes(page: Page, authenticated = false) { status: 200, contentType: "application/json", body: JSON.stringify({ + redirect: false, + token: "mock_token_123", user: { id: MOCK_USER_ID, email: "mock@cartsnitch.test", @@ -54,15 +48,6 @@ function mockAuthRoutes(page: Page, authenticated = false) { createdAt: new Date().toISOString(), updatedAt: new Date().toISOString(), }, - session: { - id: MOCK_SESSION_ID, - userId: MOCK_USER_ID, - expiresAt: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString(), - createdAt: new Date().toISOString(), - updatedAt: new Date().toISOString(), - ipAddress: null, - userAgent: null, - }, }), }); }); @@ -75,7 +60,6 @@ function mockAuthRoutes(page: Page, authenticated = false) { body: JSON.stringify({ session: { id: MOCK_SESSION_ID, - userId: MOCK_USER_ID, expiresAt: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString(), createdAt: new Date().toISOString(), updatedAt: new Date().toISOString(),