A4: app shell (layout, nav, tokens, error/empty states, /api/health)

Fixes the A4 blocker: /api/dev/complete now establishes the Auth.js session.
Root cause was UntrustedHost (trustHost defaulted false in pnpm start /
production because setEnvDefaults derives it from AUTH_URL, not NEXTAUTH_URL,
and assertConfig checks it before that default applies). Added trustHost: true
to the auth config; rebuilt. Complete response now sets authjs.session-token,
/schedule returns 200, and all 4 e2e shell tests pass.
Also ignores test-results/ artifacts.
This commit is contained in:
Tiel Coder
2026-11-17 23:35:45 +00:00
parent 3cd932e1a1
commit 3451bced82
18 changed files with 559 additions and 11 deletions
+32
View File
@@ -0,0 +1,32 @@
import { defineConfig, devices } from "@playwright/test";
/**
* E2E for the app shell. The done-criteria is "passes at 360px viewport", so
* the shell tests pin a mobile viewport. The webServer builds + starts the app
* against the same Postgres the app uses in production.
*/
export default defineConfig({
testDir: "./e2e",
fullyParallel: true,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: "list",
use: {
baseURL: "http://localhost:3000",
trace: "on-first-retry",
},
projects: [
{ name: "chromium", use: { ...devices["Desktop Chrome"] } },
],
webServer: {
command: "pnpm db:migrate && pnpm build && PORT=3000 pnpm start",
url: "http://localhost:3000",
reuseExistingServer: true,
env: {
DATABASE_URL: "postgres://media:media@localhost:5433/media",
NEXTAUTH_SECRET: "e2e-secret-for-shell-tests",
AUTO_ACTIVATE_NEW_USERS: "true",
},
timeout: 180_000,
},
});