refactor(insta): instaUtils(fmtDate)+usePollTask 훅+StatusBadge/TaskStatusBox 추출

This commit is contained in:
2026-07-10 13:31:23 +09:00
parent 25a8be6e23
commit dfe621362d
6 changed files with 101 additions and 75 deletions

View 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);
});
});