Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

ThreadRelationshipsControl.test.tsx

19 lines696 Bytes

1import { describe, expect, it } from "vite-plus/test";
2​
3import { resolveThreadLineageWindow } from "./ThreadRelationshipsControl";
4​
5const rows = Array.from({ length: 20 }, (_, index) => `row-${index}`);
6​
7describe("thread lineage window", () => {
8 it("shows six rows before the first expansion", () => {
9 const { visibleRows, hiddenCount } = resolveThreadLineageWindow(rows, 6);
10​
11 expect(visibleRows).toEqual(rows.slice(0, 6));
12 expect(hiddenCount).toBe(14);
13 });
14​
15 it("hides nothing when everything fits", () => {
16 expect(resolveThreadLineageWindow(rows, rows.length).hiddenCount).toBe(0);
17 expect(resolveThreadLineageWindow(rows.slice(0, 6), 6).hiddenCount).toBe(0);
18 });
19});