import { describe, expect, it } from 'vitest' import { resizedLeadingPanelWidth, resizedTrailingPanelWidth, resizedVerticalSplitPercent, } from '../../composables/useManualLayoutResize' describe('manual layout resize helpers', () => { const limits = { minWidth: 260, maxWidth: 480, mainMinWidth: 560, layoutGap: 16 } it('clamps leading, trailing, and vertical splits', () => { expect(resizedLeadingPanelWidth(320, 400, 900, limits)).toBe(324) expect(resizedTrailingPanelWidth(320, -400, 1400, limits)).toBe(480) expect(resizedVerticalSplitPercent(60, 400, 800, { minPercent: 35, maxPercent: 75 })).toBe(75) }) it('preserves the panel minimum when the container cannot fit both panes', () => { expect(resizedLeadingPanelWidth(320, 0, 500, limits)).toBe(260) expect(resizedTrailingPanelWidth(320, 0, 800, limits)).toBe(260) }) })