Files

19 lines
544 B
JavaScript
Raw Permalink Normal View History

import { describe, expect, it } from 'vitest';
import { formatDate } from '../../../src/features/shared/date-utils.js';
describe('formatDate', () => {
it('returns fallback when date value is missing', () => {
expect(formatDate('')).toBe('Not set');
expect(formatDate(null)).toBe('Not set');
});
it('returns the raw input for invalid date values', () => {
expect(formatDate('not-a-date')).toBe('not-a-date');
});
it('formats valid date values', () => {
expect(formatDate('2026-01-15')).toContain('2026');
});
});