CI red on main: geschichten overview component tests crash on missing drafts mock #814
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Symptom
The CI test job on
mainfails since PR #813 was merged: all 15 tests infrontend/src/routes/geschichten/page.svelte.test.tscrash withRoot cause
PR #813 added the Entwürfe (drafts) section to
routes/geschichten/+page.svelte, which readsdata.drafts.length. The server load (+page.server.ts) always returns adraftsarray (empty for non-blog-writers), so the non-optional access is correct per the load contract.However, the page has two test files:
page.svelte.spec.ts— added by PR #813 itself, mocks includedrafts✅page.svelte.test.ts— pre-existing coverage tests (b4d25620…6ba89da8); itsbaseData()helper builds the mockPageDatawithoutdrafts❌The #813 branch diverged before the coverage commits landed on main, so neither branch's CI saw the combination — a semantic merge conflict that only surfaced on main after merge.
Fix
Add
drafts: []tobaseData()inpage.svelte.test.tsso the mock matches what+page.server.tsalways returns. Drafts rendering itself is already covered bypage.svelte.spec.ts.