refactor(insta): instaUtils(fmtDate)+usePollTask 훅+StatusBadge/TaskStatusBox 추출
This commit is contained in:
15
src/pages/insta/instaUtils.test.js
Normal file
15
src/pages/insta/instaUtils.test.js
Normal file
@@ -0,0 +1,15 @@
|
||||
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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user