test(desktop): open buffered videos through latest-message action

Signed-off-by: Logan Johnson <loganj@squareup.com>
This commit is contained in:
Logan Johnson
2026-09-09 22:50:43 -04:00
parent b4f266dae1
commit 17c3b83c60

View File

@@ -1614,6 +1614,17 @@ test("playback speed persists across videos and reloads", async ({ page }) => {
const player = page
.locator(`[data-message-id="${emitted.id}"]`)
.getByTestId("video-player");
// Interacting with the previous player can leave the timeline reading an
// older row. Open buffered arrivals through the normal latest-message UI;
// subscription readiness alone does not make their rows visible.
await expect
.poll(async () => {
if (await player.isVisible()) return true;
const scrollToLatest = page.getByTestId("message-scroll-to-latest");
if (await scrollToLatest.isVisible()) await scrollToLatest.click();
return false;
})
.toBe(true);
await expect(player).toBeVisible();
await player.getByRole("button", { name: "Play video" }).click();
return player;