test: tolerate sticky rail subpixel rounding

This commit is contained in:
Thomas Camlong authored and ajnart committed 2026-08-01 00:43:36 +02:00
1 parent f207587791
commit 81d14e39ab
1 file changed
+3 -2
+3 -2
View File
@@ -300,8 +300,9 @@ describe("Board grid", () => {
const stickyRailY = (await expectBoundingBoxAsync(rail)).y;
await page.evaluate(() => window.scrollTo({ top: 500, behavior: "auto" }));
expect((await expectBoundingBoxAsync(rail)).y).toBeGreaterThanOrEqual(0);
expect((await expectBoundingBoxAsync(rail)).y).toBeLessThanOrEqual(stickyRailY);
const scrolledRailY = (await expectBoundingBoxAsync(rail)).y;
expect(scrolledRailY).toBeGreaterThanOrEqual(0);
expect(scrolledRailY).toBeLessThanOrEqual(stickyRailY + 0.5);
await page.evaluate(() => window.scrollTo({ top: 0, behavior: "auto" }));
await setDocumentZoomAsync(page, 1.25);