From e1f0fdf664aa3ead93290c52aed01a8888701a62 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Wed, 18 Feb 2026 22:18:31 +0000 Subject: [PATCH] Fix E2E tests --- e2e/tests/20-api-auth.spec.ts | 4 ++-- e2e/tests/global-setup.ts | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/e2e/tests/20-api-auth.spec.ts b/e2e/tests/20-api-auth.spec.ts index d611ccd..ddf15bf 100644 --- a/e2e/tests/20-api-auth.spec.ts +++ b/e2e/tests/20-api-auth.spec.ts @@ -216,7 +216,7 @@ test.describe('API Mode - 401 Login Flow', () => { await clearSessionCookie(page) // Make API call that triggers 401 (don't await - it blocks until iframe resolves) - const apiCallPromise = makeApiCall(page, '/auth/api/user-info', 'POST').catch(e => e) + const apiCallPromise = makeApiCall(page, '/auth/api/user-info', 'GET').catch(e => e) console.log('✓ Auth iframe appeared on 401') // Verify it's in login mode (not reauth) @@ -268,7 +268,7 @@ test.describe('API Mode - 401 Login Flow', () => { await setupTestHarness(page) // Make API call that triggers 401 - const apiCallPromise = makeApiCall(page, '/auth/api/user-info', 'POST') + const apiCallPromise = makeApiCall(page, '/auth/api/user-info', 'GET') // Wait for auth iframe to appear await waitForAuthIframe(page) diff --git a/e2e/tests/global-setup.ts b/e2e/tests/global-setup.ts index a268057..28462d3 100644 --- a/e2e/tests/global-setup.ts +++ b/e2e/tests/global-setup.ts @@ -1,4 +1,4 @@ -import { spawn } from 'child_process' +import { execSync, spawn } from 'child_process' import { join, dirname } from 'path' import { existsSync, mkdirSync, writeFileSync } from 'fs' import { fileURLToPath } from 'url' @@ -31,6 +31,11 @@ export default async function globalSetup() { mkdirSync(testDataDir, { recursive: true }) } + // Build the package first + console.log(' Building package with uv build...') + execSync('uv build', { cwd: projectRoot, stdio: 'inherit' }) + console.log(' ✅ Build complete\n') + console.log(' Starting server with in-memory database...') if (COLLECT_COVERAGE) { console.log(' 📊 Coverage collection enabled for Python backend')