From acec8135e1ec7c9c3c255e5b23733a0ef862b590 Mon Sep 17 00:00:00 2001 From: Tudor Date: Sun, 5 Jul 2026 14:29:43 +0100 Subject: [PATCH] fix(e2e): pick the latest explicit year in the rankings year test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Staging doesn't always carry the full data history, so selecting the oldest year legitimately returns no rows and fails the promotion gate. Select the most recent explicit year instead: the default view already proved it has rows, so an empty table after selecting it can only mean the year query param was rejected — the regression this test guards. Co-Authored-By: Claude Fable 5 --- e2e/tests/journeys.spec.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/e2e/tests/journeys.spec.ts b/e2e/tests/journeys.spec.ts index 07c4c4e..2ae9462 100644 --- a/e2e/tests/journeys.spec.ts +++ b/e2e/tests/journeys.spec.ts @@ -81,8 +81,11 @@ test('rankings stay populated after picking a specific year', async ({ page }) = const yearSelect = page.locator('#year-select'); await expect(yearSelect).toBeVisible({ timeout: 15_000 }); - // Pick the first explicit year option (index 0 is the "Latest" default). - const yearValue = await yearSelect.locator('option').nth(1).getAttribute('value'); + // Pick the last option — the most recent explicit year. The default view + // already proved this year has rows, so an empty table after selecting it + // can only mean the year param was rejected. (The oldest year is no good + // here: staging doesn't always carry the full data history.) + const yearValue = await yearSelect.locator('option').last().getAttribute('value'); expect(yearValue).toBeTruthy(); await yearSelect.selectOption(yearValue!); await page.waitForURL(/year=/); -- 2.54.0