From 19a32b42aa3cfdb783061e1076d8eb9c37a143ea Mon Sep 17 00:00:00 2001 From: Fleet City Date: Sun, 13 Sep 2026 21:38:03 +0000 Subject: [PATCH] fix(website): align events e2e past-card filter with the page's end-time status model The 'cards carry the same upcoming and past CTAs' test picked the past card with a naive startDateTime < Date.now() filter, but the page derives past/upcoming from eventStatus (end-time based: start + 1h default duration). Once a linked event (UCAN, 2026-09-13T14:00-07:00) started, the test treated its still-upcoming card as past, expected a LEARN MORE link that the page correctly does not render, and failed red main (CI: Website E2E push run 34782685000 on 8190935cd). Select the past card from pastEvents - the same derived, end-time-based model the page renders - so the test and page agree by construction. --- apps/website/e2e/events.spec.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/website/e2e/events.spec.ts b/apps/website/e2e/events.spec.ts index e7f1addd7e3..74efba61b78 100644 --- a/apps/website/e2e/events.spec.ts +++ b/apps/website/e2e/events.spec.ts @@ -549,10 +549,11 @@ test.describe('Events page — desktop @smoke', () => { }) ).toBeVisible() - // A past card links out instead of offering the menu. - const past = directoryEvents.find( - (event) => Date.parse(event.startDateTime) < Date.now() && event.link - ) + // A past card links out instead of offering the menu. Use the same derived + // status model the page renders (end-time based): an event that has started + // but not yet ended still shows its upcoming CTA on the page, so a naive + // start-time filter here disagrees with it for the duration of the event. + const past = pastEvents.find((event) => event.link) if (past) { await page.keyboard.press('Escape') const pastCard = cards.filter({ hasText: past.title.en }).first()