import * as React from 'react';
import {
  cleanup,
  render,
  screen,
} from '@testing-library/react';
import {
  expect,
  describe,
  it,
  afterEach,
} from 'vitest';
import matchers from '@testing-library/jest-dom/matchers';
import {
  Badge,
} from '.';

expect.extend(matchers);

describe('Badge', () => {
  afterEach(() => {
    cleanup();
  });

  it('renders a badge', () => {
    render(
      <Badge />,
    );
    const badge: HTMLButtonElement = screen.getByTestId('badge');
    expect(badge).toBeInTheDocument();
    expect(badge).toHaveClass('rounded px-1');
  });

  it('renders a rounded badge', () => {
    render(
      <Badge
        rounded
      />,
    );
    const badge: HTMLButtonElement = screen.getByTestId('badge');
    expect(badge).toBeInTheDocument();
    expect(badge).toHaveClass('rounded-full px-2');
  });
});
