mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 04:32:42 +00:00
Authenticated specs need a deterministic user and a persistent session cookie. global-setup.ts upserts an `e2e-tester` admin via raw `pg` (the generated Prisma client uses ESM `import.meta.url`, which Playwright's TS loader cannot resolve), then logs the user in once and writes `storageState.json` so every authenticated spec reuses the same session — the per-IP login rate-limit (5 attempts / 15 min) would otherwise lock out the suite the moment six specs run in parallel. Adds `pg` + `@types/pg` as devDependencies — required for the seed step. `pg` is already used by `scripts/seed-demo.ts` for the same loader-incompatibility reason, so we're not introducing a new dependency footprint, only making it explicit in the lockfile. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>