test(geschichten): add drafts to the overview page test mock data #815

Merged
marcel merged 1 commits from fix/814-geschichten-drafts-test-mock into main 2026-06-12 22:11:04 +02:00
Owner

Fixes the red CI on main: all 15 tests in frontend/src/routes/geschichten/page.svelte.test.ts crashed with TypeError: Cannot read properties of undefined (reading 'length') at +page.svelte:137.

PR #813 added the Entwürfe section reading data.drafts, which +page.server.ts always returns — but the pre-existing page.svelte.test.ts mock (baseData()) predates the field, and the #813 branch diverged before those coverage tests landed, so the combination was only exercised on main after merge.

One-line fix: add drafts: [] to baseData() so the mock matches the load contract. Drafts rendering itself is already covered by page.svelte.spec.ts from #813.

Verified locally: npx vitest run --project=client src/routes/geschichten/page.svelte.test.ts → 15 passed.

Closes #814

🤖 Generated with Claude Code

Fixes the red CI on `main`: all 15 tests in `frontend/src/routes/geschichten/page.svelte.test.ts` crashed with `TypeError: Cannot read properties of undefined (reading 'length')` at `+page.svelte:137`. PR #813 added the Entwürfe section reading `data.drafts`, which `+page.server.ts` always returns — but the pre-existing `page.svelte.test.ts` mock (`baseData()`) predates the field, and the #813 branch diverged before those coverage tests landed, so the combination was only exercised on main after merge. One-line fix: add `drafts: []` to `baseData()` so the mock matches the load contract. Drafts rendering itself is already covered by `page.svelte.spec.ts` from #813. Verified locally: `npx vitest run --project=client src/routes/geschichten/page.svelte.test.ts` → 15 passed. Closes #814 🤖 Generated with [Claude Code](https://claude.com/claude-code)
marcel added 1 commit 2026-06-12 22:06:27 +02:00
test(geschichten): add drafts to the overview page test mock data
Some checks failed
CI / Compose Bucket Idempotency (pull_request) Waiting to run
CI / OCR Service Tests (pull_request) Has been cancelled
CI / Backend Unit Tests (pull_request) Has been cancelled
CI / fail2ban Regex (pull_request) Has been cancelled
CI / Semgrep Security Scan (pull_request) Has been cancelled
CI / Unit & Component Tests (pull_request) Has been cancelled
CI / Unit & Component Tests (push) Successful in 4m37s
CI / OCR Service Tests (push) Successful in 26s
CI / Backend Unit Tests (push) Successful in 5m25s
CI / fail2ban Regex (push) Successful in 47s
CI / Semgrep Security Scan (push) Successful in 27s
CI / Compose Bucket Idempotency (push) Successful in 1m7s
f64acbc697
PR #813 made +page.svelte read data.drafts, which the load function
always returns, but the pre-existing page.svelte.test.ts mock predates
the field — all 15 tests crashed with TypeError on main after merge.

Closes #814
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
marcel merged commit f64acbc697 into main 2026-06-12 22:11:04 +02:00
marcel deleted branch fix/814-geschichten-drafts-test-mock 2026-06-12 22:11:04 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: marcel/familienarchiv#815