import { it, expect } from 'vitest' import { dashboardExportSize } from './qaDashboardExport' it('exports the complete viewBox at double resolution and refuses unsafe canvas sizes', () => { expect(dashboardExportSize(1280, 1500)).toEqual({ width: 1280 * 2, height: 1500 * 2, scale: 2 }) expect(dashboardExportSize(2000, 9000)).toEqual({ width: 2000, height: 9000, scale: 1 }) for (const size of [ [0, 100], [-1, 100], [Infinity, 100], [100, 40000], [20000, 20000], ]) expect(() => dashboardExportSize(...(size as [number, number]))).toThrow() })