Skip to content

Commit 213628b

Browse files
test(web): PDF viewer mounts pages two viewports below the visible bottom
Reproduces #35650: visiblePdfPages stops one viewport short of its documented prerender window. AI-assisted; verified with the tests and tools listed above.
1 parent a3cde98 commit 213628b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎apps/web/src/components/files/pdfLayout.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ describe("mixed-height page layout", () => {
6767
expect(indexes(0, 100)).toEqual([0, 1]);
6868
expect(indexes(1100, 100)).toEqual([2]);
6969
expect(indexes(1100, 900)).toEqual([1, 2]);
70+
// Page 2 starts 180px (1.8 viewports) below the visible bottom of 800.
71+
expect(indexes(700, 100)).toEqual([1, 2]);
7072
expect(visiblePdfPages(ratios, offsets, 0, 100)[0]).toEqual({ index: 0, ratio: ratios[0] });
7173
});
7274

0 commit comments

Comments
 (0)