diff --git a/pipeline/tests/test_schema_contract.py b/pipeline/tests/test_schema_contract.py index 3a2304c..01d625a 100644 --- a/pipeline/tests/test_schema_contract.py +++ b/pipeline/tests/test_schema_contract.py @@ -78,7 +78,7 @@ def tearDownClass(cls) -> None: sys.modules[name] = mod def test_extract_stories_event_row_keys(self) -> None: - row = self.extract_stories._to_event_row( + row, _superseded_id = self.extract_stories._to_event_row( { "id": "3894795737410658765", "handle": "cyber_ucr", diff --git a/src/components/events/EventCalendarMenu.tsx b/src/components/events/EventCalendarMenu.tsx index bcc2ee0..faea7ae 100644 --- a/src/components/events/EventCalendarMenu.tsx +++ b/src/components/events/EventCalendarMenu.tsx @@ -94,6 +94,7 @@ export function EventCalendarMenu({ return (
diff --git a/tests/e2e/events-browser-contract.spec.ts b/tests/e2e/events-browser-contract.spec.ts index b7de9f1..04210ce 100644 --- a/tests/e2e/events-browser-contract.spec.ts +++ b/tests/e2e/events-browser-contract.spec.ts @@ -62,20 +62,22 @@ test("calendar shows loading state while month events refresh", async ({ const calendarRail = page.locator( 'aside[aria-label="Calendar and time filter"]' ); - await expect(calendarRail.getByRole("heading")).toBeVisible(); + const calendarHeading = calendarRail.getByRole("heading", { level: 2 }); + await expect(calendarRail).toBeVisible(); + // The calendar follows the feed's first visible day, so it settles on the + // observed month (May 2026) shortly after load. Wait for that initial sync to + // finish before testing a navigation fetch — otherwise the stray sync request + // races the click and the displayed month reads as already-loaded on slow CI. + await expect(calendarHeading).toHaveText(/may 2026/i); let releaseCalendarResponse!: () => void; const calendarResponse = new Promise((resolve) => { releaseCalendarResponse = resolve; }); - let blockCalendarFetch = false; + // Installed only after the initial sync settled, so the single request it holds + // open is the one triggered by the Next-month click below. await page.route("**/api/events/calendar**", async (route) => { - if (!blockCalendarFetch) { - await route.continue(); - return; - } - await calendarResponse; await route.fulfill({ status: 200, @@ -85,10 +87,8 @@ test("calendar shows loading state while month events refresh", async ({ }); const calendarGrid = calendarRail.locator("[aria-busy]").first(); - blockCalendarFetch = true; - const fetchStarted = page.waitForRequest("**/api/events/calendar**"); await calendarRail.getByRole("button", { name: "Next month" }).click(); - await fetchStarted; + await expect(calendarHeading).toHaveText(/june 2026/i); await expect(calendarGrid).toHaveAttribute("aria-busy", "true"); releaseCalendarResponse();