import React from 'react';
import { describe, it, expect } from 'vitest';
import { render, screen } from '@testing-library/react';
import { EmptyState } from '@/components/ui/EmptyState';

describe('EmptyState', () => {
  it('renders default title and description', () => {
    render(<EmptyState />);
    expect(screen.getByText('Nichts gefunden')).toBeInTheDocument();
    expect(screen.getByText('Es sind noch keine Daten vorhanden.')).toBeInTheDocument();
  });

  it('renders custom title and description', () => {
    render(<EmptyState title="Keine Firmen" description="Erstellen Sie Ihre erste Firma." />);
    expect(screen.getByText('Keine Firmen')).toBeInTheDocument();
    expect(screen.getByText('Erstellen Sie Ihre erste Firma.')).toBeInTheDocument();
  });

  it('renders action when provided', () => {
    render(<EmptyState action={<button>Firma erstellen</button>} />);
    expect(screen.getByRole('button', { name: 'Firma erstellen' })).toBeInTheDocument();
  });

  it('has role=status', () => {
    render(<EmptyState />);
    expect(screen.getByRole('status')).toBeInTheDocument();
  });
});
