From 2185150990a93663e79ae088034e07e89acde54d Mon Sep 17 00:00:00 2001 From: Marcel Date: Fri, 12 Jun 2026 18:53:48 +0200 Subject: [PATCH] =?UTF-8?q?test(geschichten/page):=20add=20failing=20tests?= =?UTF-8?q?=20for=20gated=20Ver=C3=B6ffentlicht=20heading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- .../src/routes/geschichten/page.svelte.spec.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/frontend/src/routes/geschichten/page.svelte.spec.ts b/frontend/src/routes/geschichten/page.svelte.spec.ts index 42604a9e..059eb589 100644 --- a/frontend/src/routes/geschichten/page.svelte.spec.ts +++ b/frontend/src/routes/geschichten/page.svelte.spec.ts @@ -392,4 +392,20 @@ describe('geschichten page — Entwürfe section', () => { const badge = document.querySelector('[data-testid="draft-badge"]'); expect(badge).not.toBeNull(); }); + + it('Veröffentlicht heading is present when the Entwürfe section is visible', async () => { + render(Page, { data: makeData({ drafts: [draft()] as PageData['geschichten'] }) }); + const heading = Array.from(document.querySelectorAll('h2')).find( + (h) => h.textContent?.includes('Veröffentlicht') || h.textContent?.includes('Published') + ); + expect(heading).not.toBeUndefined(); + }); + + it('Veröffentlicht heading is absent when there are no drafts', async () => { + render(Page, { data: makeData({ drafts: [] }) }); + const heading = Array.from(document.querySelectorAll('h2')).find( + (h) => h.textContent?.includes('Veröffentlicht') || h.textContent?.includes('Published') + ); + expect(heading).toBeUndefined(); + }); });