Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Nov 27, 2024
1 parent 10104ed commit 68b6211
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/kit/test/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ export const test = base.extend({
y = Math.trunc(y);
const watcher = page.waitForFunction(
/** @param {{ x: number, y: number }} opt */ (opt) =>
window.scrollX === opt.x && window.scrollY === opt.y,
// check if the scroll position reached the desired or maximum position
window.scrollX === Math.min(opt.x, document.documentElement.offsetWidth - window.innerWidth) &&
window.scrollY === Math.min(opt.y, document.documentElement.offsetHeight - window.innerHeight),
{ x, y }
);
await page.evaluate(
Expand Down

0 comments on commit 68b6211

Please sign in to comment.