import { describe, expect, it } from 'vitest' import { computeStageRowHeight } from '@/lib/timetable/row-height' /** * One-line helper, four assertion cases — keep this surface tight; this * is the canonical row-height math for both StageRow content and the * sticky-left StageHeaderCell. If either side drifts, the freeze panes * misalign in the browser. The math: * * max(1, laneCount) × (laneHeight + lanePad) + lanePad * * with the canonical constants laneHeight=44, lanePad=4 → 48 per lane + 4. */ const LANE_HEIGHT = 44 const LANE_PAD = 4 describe('computeStageRowHeight', () => { it('falls back to single-lane height when laneCount is 0', () => { expect(computeStageRowHeight(0, LANE_HEIGHT, LANE_PAD)).toBe(52) }) it('returns 52px for laneCount=1', () => { expect(computeStageRowHeight(1, LANE_HEIGHT, LANE_PAD)).toBe(52) }) it('returns 148px for laneCount=3', () => { expect(computeStageRowHeight(3, LANE_HEIGHT, LANE_PAD)).toBe(148) }) it('returns 484px for laneCount=10 (10 × 48 + 4)', () => { expect(computeStageRowHeight(10, LANE_HEIGHT, LANE_PAD)).toBe(484) }) })