Files
familienarchiv/frontend/scripts
Marcel 5167a2ae18 test+fix(stammbaum): capture script refuses default creds and non-localhost (#361)
@Nora + @Tobias on PR #693: defaulting CAPTURE_EMAIL/PASSWORD to
documented admin creds and BACKEND_URL to localhost:8080 means an env-var
slip silently auth's against staging/prod. Make both explicit: refuse to
run unless CAPTURE_EMAIL and CAPTURE_PASSWORD are set, and unless
BACKEND_URL hostname is localhost / 127.0.0.1 / ::1.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 20:36:58 +02:00
..

frontend/scripts/

One-off developer utilities. Each script is local-only and never invoked from CI. Re-run intentionally when needed; commit any generated artefacts as a separate, atomic commit.

Script Purpose
capture-network-fixture.mjs Capture the canonical GET /api/network response into src/lib/person/genealogy/__fixtures__/stammbaum.json. Used by buildLayout.test.ts. Re-capture when the production family graph grows a new structural case (new edge type, new marriage configuration).

Usage

cd frontend
node scripts/capture-network-fixture.mjs

Defaults to BACKEND_URL=http://localhost:8080 and the dev admin credentials. Override via env vars (BACKEND_URL, CAPTURE_EMAIL, CAPTURE_PASSWORD).

The script exits non-zero if the captured fixture would be vacuous (fewer than 100 nodes, fewer than 5 generations, or zero SPOUSE_OF edges).