From bde671f9842dc265fb57b739f4d213c5d4e83821 Mon Sep 17 00:00:00 2001 From: Turtle Date: Thu, 22 Oct 2026 10:53:52 +0800 Subject: [PATCH] test(web): ignore scroll-driven animations when waiting for settled layout The model selector's clipped-text fade runs on a scroll timeline, which never finishes, so document-wide waits never settled. --- apps/web/tests/context-meter.e2e.ts | 3 ++- apps/web/tests/window-drag-coverage.e2e.ts | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/web/tests/context-meter.e2e.ts b/apps/web/tests/context-meter.e2e.ts index 8eab8e868e..bf3fff1fc6 100644 --- a/apps/web/tests/context-meter.e2e.ts +++ b/apps/web/tests/context-meter.e2e.ts @@ -57,7 +57,8 @@ describe.skipIf(webSnapshotMode() === 'record')('web e2e: context details placem }) await page.evaluate(async () => { await Promise.all(document.getAnimations() - .filter(animation => animation.effect?.getComputedTiming().iterations !== Infinity) + .filter(animation => animation.timeline === document.timeline + && animation.effect?.getComputedTiming().iterations !== Infinity) .map(animation => animation.finished.catch(() => undefined))) }) await expect.poll(async () => { diff --git a/apps/web/tests/window-drag-coverage.e2e.ts b/apps/web/tests/window-drag-coverage.e2e.ts index cb6df06778..16b91f73ec 100644 --- a/apps/web/tests/window-drag-coverage.e2e.ts +++ b/apps/web/tests/window-drag-coverage.e2e.ts @@ -169,13 +169,15 @@ function firstRecallPulse(page: Page): Promise { } /** - * Wait until nothing under the page is animating, so a probe measures the settled - * layout instead of a frame of a column slide. + * Wait until no time-based animation under the page is running, so a probe measures + * the settled layout instead of a frame of a column slide. Scroll-driven animations + * never finish and are ignored. * @param page - the page under test. */ async function settled(page: Page): Promise { await expect.poll(() => page.evaluate(() => document.getAnimations() - .every(animation => animation.playState === 'finished' || animation.playState === 'idle')), + .every(animation => animation.timeline !== document.timeline + || animation.playState === 'finished' || animation.playState === 'idle')), { timeout: 20_000 }).toBe(true) }