import { render, screen } from '@testing-library/react';
import { describe, it, expect } from 'vitest';
import { StatusPill } from '../status-pill';

describe('StatusPill', () => {
  it('renders the provided label', () => {
    render(<StatusPill tone="neutral">Published</StatusPill>);
    expect(screen.getByText('Published')).toBeInTheDocument();
  });

  it('applies the forest tone class when tone=success', () => {
    render(<StatusPill tone="success">Delivered</StatusPill>);
    expect(screen.getByText('Delivered')).toHaveClass('bg-forest', 'text-bone');
  });

  it('applies terracotta when tone=warning', () => {
    render(<StatusPill tone="warning">Overdue</StatusPill>);
    expect(screen.getByText('Overdue')).toHaveClass('bg-terracotta', 'text-white');
  });

  it('applies muted when tone=muted', () => {
    render(<StatusPill tone="muted">Cancelled</StatusPill>);
    expect(screen.getByText('Cancelled')).toHaveClass('bg-ink/10', 'text-ink/70');
  });
});
