test(geschichten): add drafts to the overview page test mock data #815
Reference in New Issue
Block a user
Delete Branch "fix/814-geschichten-drafts-test-mock"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes the red CI on
main: all 15 tests infrontend/src/routes/geschichten/page.svelte.test.tscrashed withTypeError: Cannot read properties of undefined (reading 'length')at+page.svelte:137.PR #813 added the Entwürfe section reading
data.drafts, which+page.server.tsalways returns — but the pre-existingpage.svelte.test.tsmock (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: []tobaseData()so the mock matches the load contract. Drafts rendering itself is already covered bypage.svelte.spec.tsfrom #813.Verified locally:
npx vitest run --project=client src/routes/geschichten/page.svelte.test.ts→ 15 passed.Closes #814
🤖 Generated with Claude Code