import { describe, it, expect } from 'vitest';
import { render, screen } from '@testing-library/react';
import { ThemeProvider } from '@cameleer/design-system';
import { SeverityBadge } from './SeverityBadge';

function renderWithTheme(ui: React.ReactElement) {
  return render(<ThemeProvider>{ui}</ThemeProvider>);
}

describe('SeverityBadge', () => {
  it.each([
    ['CRITICAL', /critical/i],
    ['WARNING', /warning/i],
    ['INFO', /info/i],
  ] as const)('renders %s', (severity, pattern) => {
    renderWithTheme(<SeverityBadge severity={severity} />);
    expect(screen.getByText(pattern)).toBeInTheDocument();
  });
});
