From b5ffe326743e12cb83d4b7823949fd32e4ba1def Mon Sep 17 00:00:00 2001 From: TRIP <192432815+appergb@users.noreply.github.com> Date: Fri, 16 Oct 2026 03:52:27 +0800 Subject: [PATCH] test(ui): wait for complete native wheel displacement before checking rest --- openless-all/app/e2e/refinements.spec.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/openless-all/app/e2e/refinements.spec.ts b/openless-all/app/e2e/refinements.spec.ts index c39de082b..37abbcdbb 100644 --- a/openless-all/app/e2e/refinements.spec.ts +++ b/openless-all/app/e2e/refinements.spec.ts @@ -56,16 +56,14 @@ test('native scrolling has no JS wheel interception and is stable when stopped', content.locator('[data-section="general"] .ol-shortcut-binding').first(), ).toBeVisible(); await content.hover(); + const destination = await content.evaluate((el) => + Math.min(el.scrollTop + 450, el.scrollHeight - el.clientHeight), + ); await page.mouse.wheel(0, 450); - await expect.poll(() => content.evaluate((el) => el.scrollTop)).toBeGreaterThan(0); - // Let the browser's own wheel smoothing settle; its duration is OS-specific. - await expect - .poll(async () => { - const before = await content.evaluate((el) => el.scrollTop); - await page.waitForTimeout(120); - return Math.abs((await content.evaluate((el) => el.scrollTop)) - before); - }) - .toBe(0); + // A single unchanged 120ms sample can still be WebKit's intermediate 11px + // compositor position. Await the complete clamped native wheel displacement + // before asserting rest; this is stronger than accepting any positive offset. + await expect.poll(() => content.evaluate((el) => el.scrollTop)).toBe(destination); const stopped = await content.evaluate((el) => el.scrollTop); await page.waitForTimeout(160); expect(await content.evaluate((el) => el.scrollTop)).toBe(stopped);