Merge pull request #20380 from timvandermeij/integration-tests-tweak-viewer-scroll

Tweak the "scroll into view" viewer integration test
This commit is contained in:
calixteman 2025-10-19 20:37:30 +02:00 committed by GitHub
commit a40df9a5be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1453,10 +1453,12 @@ describe("PDF viewer", () => {
const rect = await getRect(page, annotationSelector);
const containerRect = await getRect(page, "#viewerContainer");
expect(
Math.abs(2 * (rect.y - containerRect.y) - containerRect.height)
Math.abs(
2 * (Math.ceil(rect.y) - containerRect.y) - containerRect.height
)
)
.withContext(`In ${browserName}`)
.toBeLessThan(1);
.toBeLessThanOrEqual(1);
})
);
});