16 lines
531 B
JavaScript
16 lines
531 B
JavaScript
import { describe, it, expect } from 'vitest';
|
|
import { fmtDate } from './instaUtils';
|
|
|
|
describe('instaUtils.fmtDate', () => {
|
|
it('returns empty string for falsy input', () => {
|
|
expect(fmtDate('')).toBe('');
|
|
expect(fmtDate(null)).toBe('');
|
|
expect(fmtDate(undefined)).toBe('');
|
|
});
|
|
it('returns a non-empty string for a valid ISO date (locale/tz-dependent format)', () => {
|
|
const out = fmtDate('2026-07-10T09:30:00Z');
|
|
expect(typeof out).toBe('string');
|
|
expect(out.length).toBeGreaterThan(0);
|
|
});
|
|
});
|