diff --git a/frontend/src/lib/shared/dashboard/DashboardFamilyPulse.svelte b/frontend/src/lib/shared/dashboard/DashboardFamilyPulse.svelte index 44f89542..7ae91ff2 100644 --- a/frontend/src/lib/shared/dashboard/DashboardFamilyPulse.svelte +++ b/frontend/src/lib/shared/dashboard/DashboardFamilyPulse.svelte @@ -1,6 +1,7 @@ {#if pulse !== null} -
-

- {m.pulse_eyebrow()} -

- + + {#if pulse.pages > 0}

{m.pulse_headline({ pages: pulse.pages })} @@ -66,5 +69,5 @@ const { pulse }: Props = $props(); -

+ {/if} diff --git a/frontend/src/lib/shared/dashboard/DashboardFamilyPulse.svelte.test.ts b/frontend/src/lib/shared/dashboard/DashboardFamilyPulse.svelte.test.ts index 35b579af..967c51fb 100644 --- a/frontend/src/lib/shared/dashboard/DashboardFamilyPulse.svelte.test.ts +++ b/frontend/src/lib/shared/dashboard/DashboardFamilyPulse.svelte.test.ts @@ -20,7 +20,8 @@ describe('DashboardFamilyPulse', () => { it('renders nothing when pulse is null', async () => { render(DashboardFamilyPulse, { props: { pulse: null } }); - expect(document.querySelector('section')).toBeNull(); + // Component now renders via Card primitive (div, not section) + expect(document.querySelector('[data-testid="card"]')).toBeNull(); }); it('renders the eyebrow when pulse is not null', async () => { @@ -29,10 +30,12 @@ describe('DashboardFamilyPulse', () => { await expect.element(page.getByText('Diese Woche')).toBeVisible(); }); - it('hides the headline when pages is 0', async () => { + it('hides the pulse headline when pages is 0', async () => { render(DashboardFamilyPulse, { props: { pulse: basePulse({ pages: 0 }) } }); - await expect.element(page.getByRole('heading')).not.toBeInTheDocument(); + // The Card caption is always rendered as an h2; check the pulse headline (h2 inside Card children) + // specifically by its text content — it should not appear when pages is 0 + await expect.element(page.getByText(/Seiten bearbeitet/)).not.toBeInTheDocument(); }); it('renders the headline when pages > 0', async () => {