1import { describe, expect, it } from "vite-plus/test";
2import { pullRequestTabOffset } from "./pullRequestTabScroll";
3
4describe("pull request tab scroll", () => {
5 it("keeps the header fixed while switching, even if the destination was scrolled deeply", () => {
6 expect(pullRequestTabOffset(-100, 900, 200)).toBe(-100);
7 expect(pullRequestTabOffset(75, 900, 200)).toBe(75);
8 });
9 it("resumes the destination body only when the shared header is already collapsed", () => {
10 expect(pullRequestTabOffset(600, 900, 200)).toBe(900);
11 expect(pullRequestTabOffset(600, 50, 200)).toBe(200);
12 expect(pullRequestTabOffset(600, undefined, 200)).toBe(200);
13 });
14});