From 061018961d555a1877ac45fa8ff1327f00cc61be Mon Sep 17 00:00:00 2001 From: Julius Gruber Date: Mon, 1 Jun 2026 12:03:08 +0200 Subject: [PATCH] fix(e2e): derive burndown current-month assertion from the clock The "shows current month" test hard-coded `toContain('May 2026')`, but the burndown page computes its month label from the live system clock: page-burndown.ts defaults selectedMonth from `new Date()` and renders it via formatMonthLabel's `toLocaleString('default', { month: 'long', year: 'numeric' })`. The assertion therefore only passed during May 2026 and fails on every later month (the page correctly renders "June 2026", etc.). Derive the expected label the same way the component does so the test tracks the clock instead of going stale on each month rollover. Test-only change. --- tests/e2e/burndown.spec.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/e2e/burndown.spec.ts b/tests/e2e/burndown.spec.ts index 6368aa3..d25cca4 100644 --- a/tests/e2e/burndown.spec.ts +++ b/tests/e2e/burndown.spec.ts @@ -45,6 +45,10 @@ test.describe('Burndown', () => { test('shows current month', async ({ page }) => { const content = await page.textContent('#content'); - expect(content).toContain('May 2026'); + // The burndown page defaults to the live current month (page-burndown.ts uses new Date() + // and formatMonthLabel's toLocaleString), so derive the expected label the same way + // instead of hard-coding it — otherwise the assertion goes stale every month rollover. + const expectedMonth = new Date().toLocaleString('default', { month: 'long', year: 'numeric' }); + expect(content).toContain(expectedMonth); }); });