The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { describe, expect, it } from "vite-plus/test"; |
| 2 | |
| 3 | import { resolveCenteredFileLineScrollTop } from "./fileLineReveal"; |
| 4 | |
| 5 | describe("resolveCenteredFileLineScrollTop", () => { |
| 6 | it("corrects a stale estimate from the rendered line geometry", () => { |
| 7 | expect( |
| 8 | resolveCenteredFileLineScrollTop({ |
| 9 | scrollTop: 830, |
| 10 | scrollHeight: 2_000, |
| 11 | viewportTop: 100, |
| 12 | viewportHeight: 400, |
| 13 | fileTop: 20, |
| 14 | estimatedLine: { top: 1_000, height: 20 }, |
| 15 | renderedLine: { top: 620, height: 20 }, |
| 16 | }), |
| 17 | ).toBe(1_160); |
| 18 | }); |
| 19 | }); |