deckhearth/test/lib/format-relative-time.test.js
varutasu b9e840ff3a
Realign dashboard home nav and wire honest ownership stats (#164)
Flatten authenticated sidebar IA, move admin to the profile menu, right-align TopSearchBar actions, and replace placeholder dashboard panels with data from /api/user/stats and /api/user-cards.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-15 16:47:59 -05:00

14 lines
500 B
JavaScript

import { describe, it, expect } from 'vitest';
import { formatRelativeTime } from '../../lib/format-relative-time.js';
describe('formatRelativeTime', () => {
it('returns empty string for missing input', () => {
expect(formatRelativeTime()).toBe('');
expect(formatRelativeTime('')).toBe('');
});
it('formats recent minutes', () => {
const fiveMinutesAgo = new Date(Date.now() - 5 * 60 * 1000).toISOString();
expect(formatRelativeTime(fiveMinutesAgo)).toBe('5m ago');
});
});