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

describe('Divider', () => {
  it('renders with role="separator"', () => {
    render(<Divider />);
    expect(screen.getByRole('separator')).toBeInTheDocument();
  });

  it('defaults to horizontal orientation', () => {
    render(<Divider data-testid="d" />);
    expect(screen.getByTestId('d')).toHaveAttribute('aria-orientation', 'horizontal');
  });

  it('renders vertical orientation', () => {
    render(<Divider data-testid="d" orientation="vertical" />);
    expect(screen.getByTestId('d')).toHaveAttribute('aria-orientation', 'vertical');
    expect(screen.getByTestId('d')).toHaveClass('h-full', 'w-px');
  });

  it('applies strong variant class', () => {
    render(<Divider data-testid="d" strong />);
    expect(screen.getByTestId('d')).toHaveClass('bg-border-strong');
  });

  it('applies default border class without strong', () => {
    render(<Divider data-testid="d" />);
    expect(screen.getByTestId('d')).toHaveClass('bg-border');
  });

  it('horizontal adds h-px and w-full', () => {
    render(<Divider data-testid="d" orientation="horizontal" />);
    expect(screen.getByTestId('d')).toHaveClass('h-px', 'w-full');
  });

  it('merges custom className', () => {
    render(<Divider data-testid="d" className="my-custom" />);
    expect(screen.getByTestId('d')).toHaveClass('my-custom');
  });
});
