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 }) => {