import { it, expect } from 'vitest' import { ledgerWindow } from './qaLedgerRendering' it('keeps a bounded viewport while all records remain reachable without pagination', () => { const total = 6041, seen = new Set() for (let top = 0; top < total * 108; top += 540) { const w = ledgerWindow(total, top, 600) expect(w.end - w.start).toBeLessThanOrEqual(23) expect(w.padTop + (w.end - w.start) * 108 + w.padBottom).toBe(total * 108) for (let i = w.start; i < w.end; i++) seen.add(i) } expect(seen.size).toBe(total) expect(ledgerWindow(total, total * 108, 600).end).toBe(total) })