From bbbb3564b6dbff653e25a0b2565b4b18ba806a0e Mon Sep 17 00:00:00 2001 From: Wintermute <165f0c871dd2586bb18b6aa109eeaf57bb2132ff4d27b10120f4368a0f627022@buzz.block.builderlab.xyz> Date: Sun, 16 Aug 2026 20:28:52 -0400 Subject: [PATCH] test(desktop): fix day-divider strict-mode failure across midnight UTC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The general-channel welcome seeds are backdated by up to 120s, so a smoke run that straddles midnight UTC renders two day dividers (Yesterday + Today). Three specs asserted toBeVisible() on the bare message-timeline-day-divider locator, which Playwright strict mode rejects the moment two dividers exist — this is what failed Desktop Smoke E2E shard 3 on the 23:53 UTC run of PR #6003 (test started before midnight, assertion ran after). Assert .first() visibility instead at all three sites (messaging.spec.ts day-divider test, channels.spec.ts general-channel content test, and the DM unread-clear test). The tests' intent is "a divider appears", which the first divider proves on both sides of midnight. Pre-existing on main; surfaced here because the PR run happened to cross the boundary. Co-authored-by: Thomas Petersen Signed-off-by: Thomas Petersen --- desktop/tests/e2e/channels.spec.ts | 12 ++++++++++-- desktop/tests/e2e/messaging.spec.ts | 8 +++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/desktop/tests/e2e/channels.spec.ts b/desktop/tests/e2e/channels.spec.ts index 74ccce73a..8ba1793b9 100644 --- a/desktop/tests/e2e/channels.spec.ts +++ b/desktop/tests/e2e/channels.spec.ts @@ -1869,7 +1869,11 @@ test("channel with messages shows content", async ({ page }) => { await expect(page.getByTestId("welcome-composer-guide-banner")).toHaveCount( 0, ); - await expect(page.getByTestId("message-timeline-day-divider")).toBeVisible(); + // `.first()`: backdated seeds can straddle midnight UTC and render two + // dividers (Yesterday + Today); a bare locator fails Playwright strict mode. + await expect( + page.getByTestId("message-timeline-day-divider").first(), + ).toBeVisible(); await expect(page.getByTestId("message-timeline")).toContainText( "Welcome to general", ); @@ -2441,7 +2445,11 @@ test("sidebar clears unread indicator after opening a DM", async ({ page }) => { await expect(page.getByTestId("message-dm-intro")).toContainText( "This is the beginning of your direct message with", ); - await expect(page.getByTestId("message-timeline-day-divider")).toBeVisible(); + // `.first()`: backdated seeds can straddle midnight UTC and render two + // dividers (Yesterday + Today); a bare locator fails Playwright strict mode. + await expect( + page.getByTestId("message-timeline-day-divider").first(), + ).toBeVisible(); await expect(page.getByTestId("message-timeline")).toContainText( "Unread update for the DM", ); diff --git a/desktop/tests/e2e/messaging.spec.ts b/desktop/tests/e2e/messaging.spec.ts index f93ce0450..368a15b3f 100644 --- a/desktop/tests/e2e/messaging.spec.ts +++ b/desktop/tests/e2e/messaging.spec.ts @@ -1996,7 +1996,13 @@ test("day divider appears in timeline", async ({ page }) => { await expect(page.getByTestId("message-timeline")).toContainText( "Welcome to general", ); - await expect(page.getByTestId("message-timeline-day-divider")).toBeVisible(); + // `.first()`: the seeds are backdated by up to 120s, so a run that straddles + // midnight UTC legitimately renders two dividers (Yesterday + Today) and a + // bare locator fails Playwright strict mode. The intent is "a divider + // appears", which the first divider proves on both sides of midnight. + await expect( + page.getByTestId("message-timeline-day-divider").first(), + ).toBeVisible(); }); test("send message to DM channel p-tags the recipient", async ({ page }) => {