mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +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>
10 lines
463 B
TypeScript
10 lines
463 B
TypeScript
/**
|
|
* Re-export pin for the seeded test-user identity. The cookie jar that
|
|
* authenticates each spec is captured ONCE in `global-setup.ts` and the
|
|
* specs reach for it via `STORAGE_STATE_PATH` directly. We keep this
|
|
* file (instead of a barrel inside global-setup) only so future helpers
|
|
* specific to the spec-side (e.g. multi-user scenarios that need
|
|
* fresh logins) have a natural home.
|
|
*/
|
|
export { E2E_USER, STORAGE_STATE_PATH } from "./global-setup";
|