test(desktop): keep DM unread coverage viewport-safe

Co-authored-by: Rivet <a08d9a8418c7ff03afe19964724c8fd87bf1776ab9e9b9cafb8cc920edd02a6e@buzz.block.builderlab.xyz>
Signed-off-by: Rivet <a08d9a8418c7ff03afe19964724c8fd87bf1776ab9e9b9cafb8cc920edd02a6e@buzz.block.builderlab.xyz>
This commit is contained in:
Rivet
2026-08-24 16:42:49 -07:00
parent 1bbdb515e4
commit 4f7088d343

View File

@@ -2453,16 +2453,9 @@ 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",
);
// `.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",
);
await expectSameLeftInset(page, "message-dm-intro", "message-row");
await expectIntroSpacedAboveDayDivider(page, "message-dm-intro");
await expect(page.getByTestId("channel-unread-alice-tyler")).toHaveCount(0);
});