fix(e2e): pick the latest explicit year in the rankings year test
PR Checks / Frontend Typecheck + Tests (pull_request) Successful in 9m39s
PR Checks / Backend Smoke (pull_request) Successful in 5s
PR Checks / Build Backend (no push) (pull_request) Successful in 10s
PR Checks / Build Frontend (no push) (pull_request) Successful in 41s
PR Checks / Build Pipeline (no push) (pull_request) Successful in 9s
PR Checks / AI Code Review (Claude) (pull_request) Successful in 1m24s
PR Checks / Frontend Typecheck + Tests (pull_request) Successful in 9m39s
PR Checks / Backend Smoke (pull_request) Successful in 5s
PR Checks / Build Backend (no push) (pull_request) Successful in 10s
PR Checks / Build Frontend (no push) (pull_request) Successful in 41s
PR Checks / Build Pipeline (no push) (pull_request) Successful in 9s
PR Checks / AI Code Review (Claude) (pull_request) Successful in 1m24s
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 <noreply@anthropic.com>
This commit is contained in:
@@ -81,8 +81,11 @@ test('rankings stay populated after picking a specific year', async ({ page }) =
|
|||||||
const yearSelect = page.locator('#year-select');
|
const yearSelect = page.locator('#year-select');
|
||||||
await expect(yearSelect).toBeVisible({ timeout: 15_000 });
|
await expect(yearSelect).toBeVisible({ timeout: 15_000 });
|
||||||
|
|
||||||
// Pick the first explicit year option (index 0 is the "Latest" default).
|
// Pick the last option — the most recent explicit year. The default view
|
||||||
const yearValue = await yearSelect.locator('option').nth(1).getAttribute('value');
|
// 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();
|
expect(yearValue).toBeTruthy();
|
||||||
await yearSelect.selectOption(yearValue!);
|
await yearSelect.selectOption(yearValue!);
|
||||||
await page.waitForURL(/year=/);
|
await page.waitForURL(/year=/);
|
||||||
|
|||||||
Reference in New Issue
Block a user