it_solutions_test/src/profile/domain/period.spec.ts
Илья Братских bd22447bd3 Add a GraphQL digital card that migrates and seeds itself on startup.
The NestJS API serves the public profile through Apollo Sandbox and loads only the relations selected by the query.
2026-11-02 05:30:54 +03:00

21 lines
629 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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();
});
});