diff --git a/internal/gui/tests/checkbox-look.test.cjs b/internal/gui/tests/checkbox-look.test.cjs index 8b6d0c1c5..6189d3b5e 100644 --- a/internal/gui/tests/checkbox-look.test.cjs +++ b/internal/gui/tests/checkbox-look.test.cjs @@ -97,9 +97,12 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", await page.locator("#nav").getByRole("button", { name: nav[lang], exact: true }).click(); const view = page.locator("#view-sessions"); await view.locator('.row.sm-sess[data-id="a-login"]').waitFor(); - // read after a frame: the page's reduced-motion transitions still take one + // read once the box's own transitions end: reduced motion makes every + // transition .01ms, not none, and Chromium under load can still show + // one at its start two frames after the click const look = (l) => l.evaluate(async (e) => { - for (let i = 0; i < 2; i++) await new Promise((r) => requestAnimationFrame(r)); + await new Promise((r) => requestAnimationFrame(r)); + await Promise.all(e.getAnimations().map((a) => a.finished)); const s = getComputedStyle(e), card = getComputedStyle(document.documentElement).getPropertyValue("--card").trim(); const accent = getComputedStyle(document.documentElement).getPropertyValue("--accent").trim(); const probe = document.createElement("i");