Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

test(SnapPaging): the resting offset waits out a native smooth scroll (#10321)

Christopher Chedeau0a2ab05262b6
diff --git a/packages/core/src/SnapPaging/__tests__/SnapPaging.interaction.browser.spec.ts b/packages/core/src/SnapPaging/__tests__/SnapPaging.interaction.browser.spec.ts
index 386cfe22d4..887fb9e714 100644
--- a/packages/core/src/SnapPaging/__tests__/SnapPaging.interaction.browser.spec.ts
+++ b/packages/core/src/SnapPaging/__tests__/SnapPaging.interaction.browser.spec.ts
@@ -386,7 +386,9 @@ async function pressInSettle(
/** The row's offset once two reads a while apart agree. */
async function restingOffset(scroller: Locator) {
await settled(scroller);
- let at = await offset(scroller);
+ // The first poll only reads. Two reads in one frame agree even while a
+ // native smooth scroll runs.
+ let at = Number.NaN;
await expect
.poll(async () => {
const before = at;