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