This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { formatDateTime, hasReceivedTimestamp, NEVER_RECEIVED } from '../../src/locale';
|
||||
|
||||
describe('veilige tijdpresentatie', () => {
|
||||
it('presenteert ontbrekende, ongeldige en nulwaarden als nooit ontvangen', () => {
|
||||
expect(formatDateTime()).toBe(NEVER_RECEIVED);
|
||||
expect(formatDateTime('ongeldig')).toBe(NEVER_RECEIVED);
|
||||
expect(formatDateTime('0001-01-01T00:00:00Z')).toBe(NEVER_RECEIVED);
|
||||
expect(formatDateTime('1970-01-01T00:00:00Z')).toBe(NEVER_RECEIVED);
|
||||
});
|
||||
|
||||
it('behoudt een werkelijk ontvangen timestamp en de vaste Brusselse tijdzone', () => {
|
||||
const value = '2026-08-21T14:05:00Z';
|
||||
expect(hasReceivedTimestamp(value)).toBe(true);
|
||||
expect(formatDateTime(value)).toContain('16:05');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user