import { describe, it, expect } from 'vitest';
import { statusTone, toneClasses } from './utils';

describe('statusTone', () => {
  it('returns theme-adaptive light-dark() colors', () => {
    const t = statusTone('failed');
    expect(t.bg).toBe('light-dark(#fee2e2, rgba(239,68,68,.15))');
    expect(t.fg).toBe('light-dark(#b91c1c, #fca5a5)');
  });
  it('falls back to neutral surface/muted vars', () => {
    const t = statusTone('whatever-unknown');
    expect(t.bg).toBe('light-dark(#e2e8f0, var(--surface-2))');
    expect(t.fg).toBe('light-dark(#475569, var(--muted))');
  });
});

describe('toneClasses', () => {
  it('pairs light + dark for colored tones', () => {
    expect(toneClasses('danger')).toContain('bg-red-50');
    expect(toneClasses('danger')).toContain('dark:text-red-300');
    expect(toneClasses('success')).toContain('dark:bg-emerald-500/15');
  });
  it('neutral stays on semantic tokens (auto-themed, no dark: needed)', () => {
    expect(toneClasses('neutral')).toBe('bg-surface-2 text-slate-700 border-hairline');
  });
});
