import { cleanup, render, screen } from '@testing-library/react';
import { afterEach, describe, expect, it } from 'vitest';

import { SpoonStatusBadge } from '../../src/components/spoons/spoon-status-badge';

afterEach(cleanup);

describe('SpoonStatusBadge', () => {
  it('renders a dedicated "Rate limited" label for the rate_limited status', () => {
    render(<SpoonStatusBadge status='rate_limited' />);
    expect(screen.getByText('Rate limited')).toBeInTheDocument();
  });

  it('still humanizes unknown statuses via the fallback', () => {
    render(<SpoonStatusBadge status={'some_future_state' as never} />);
    expect(screen.getByText('some future state')).toBeInTheDocument();
  });
});
