From a465dcf29d9104eba2087c3dcb23b626b6a8e2fc Mon Sep 17 00:00:00 2001 From: Logan Johnson Date: Thu, 22 Oct 2026 16:52:30 -0400 Subject: [PATCH] test(browser): fix two main CI timing failures layout.spec "simultaneous row shrink above and growth below": wait for Virtua's idle instead of a short geometry settle. Bottom follow ends in a downward scroll, and while Virtua is still scrolling it mounts only rows ahead of that direction, so no row above the viewport existed yet (WebKit, run 39844079930). reactions.spec "standalone message gallery hosts clipboard success and failure toasts": activate Copy message with Enter. The pointer click raced the popup's first placement; the inert backdrop took the hit, and Playwright's alternating scroll retries moved the page under the open menu until the click no longer reached the item (Chromium, runs 39844079930 and 39703372164). The test covers toast hosting, not pointer hit-testing. Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz> Signed-off-by: Logan Johnson --- tests/browser/layout.spec.mjs | 6 ++++-- tests/browser/reactions.spec.mjs | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/browser/layout.spec.mjs b/tests/browser/layout.spec.mjs index 2a04018d2d..c027be31c5 100644 --- a/tests/browser/layout.spec.mjs +++ b/tests/browser/layout.spec.mjs @@ -610,7 +610,9 @@ readingTest( ), ) .toBeLessThan(4); - await settle(page); + // Opening at the bottom ends in a downward scroll. Until Virtua's idle, its + // buffer covers only the side below, so no row above the viewport is mounted. + await virtuaIdle(page); await expectBottom(); const rows = await history.evaluate((element) => { const top = element.getBoundingClientRect().top; @@ -627,7 +629,7 @@ readingTest( }; }); expect(rows).not.toBeNull(); - await settle(page); + await virtuaIdle(page); await expectBottom(); await history.evaluate((element, ids) => { const row = (id) => diff --git a/tests/browser/reactions.spec.mjs b/tests/browser/reactions.spec.mjs index 60d9d238e9..54fa33a739 100644 --- a/tests/browser/reactions.spec.mjs +++ b/tests/browser/reactions.spec.mjs @@ -406,9 +406,12 @@ test("standalone message gallery hosts clipboard success and failure toasts", as await row .getByRole("button", { name: "More message actions", exact: true }) .click(); + // This test covers toast hosting, not pointer hit-testing. A pointer click + // can race the popup's first placement, and Playwright's scroll retries + // then move the page under the open menu. The keyboard path avoids both. await page .getByRole("menuitem", { name: "Copy message", exact: true }) - .click(); + .press("Enter"); }; await copy(); await expect(