16 lines
544 B
TypeScript
16 lines
544 B
TypeScript
import { parseHiboutikDate } from './date';
|
|
|
|
describe('parseHiboutikDate', () => {
|
|
it('parses a Hiboutik datetime', () => {
|
|
expect(parseHiboutikDate('2026-06-28 17:02:55')).toEqual(new Date('2026-06-28T17:02:55'));
|
|
});
|
|
|
|
it('parses a date without time', () => {
|
|
expect(parseHiboutikDate('1990-05-12')).toEqual(new Date('1990-05-12'));
|
|
});
|
|
|
|
it.each(['', '0000-00-00', '0000-00-00 00:00:00', 'not a date', null, undefined])('returns undefined for %p', (value) => {
|
|
expect(parseHiboutikDate(value)).toBeUndefined();
|
|
});
|
|
});
|