import { formatOptionalPeriod, formatPeriod } from './period.js'; describe('work period', () => { it('keeps an open period in the resume wording', () => { expect(formatPeriod(2023, null)).toBe('2023 — н.в.'); }); it('joins a closed range with an en dash', () => { expect(formatPeriod(2022, 2023)).toBe('2022–2023'); }); it('collapses a single year', () => { expect(formatPeriod(2024, 2024)).toBe('2024'); }); it('omits a period when the start year is unknown', () => { expect(formatOptionalPeriod(null, null)).toBeNull(); expect(formatOptionalPeriod(null, 2024)).toBeNull(); }); });