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

describe('Card', () => {
  it('renders children content', () => {
    render(<Card>Inhalt der Karte</Card>);
    expect(screen.getByText('Inhalt der Karte')).toBeInTheDocument();
  });

  it('renders title when provided', () => {
    render(<Card title="Firmendetails">Inhalt</Card>);
    expect(screen.getByText('Firmendetails')).toBeInTheDocument();
  });

  it('renders description when provided', () => {
    render(<Card title="Test" description="Eine Beschreibung">Inhalt</Card>);
    expect(screen.getByText('Eine Beschreibung')).toBeInTheDocument();
  });

  it('renders footer when provided', () => {
    render(<Card footer={<button>Aktion</button>}>Inhalt</Card>);
    expect(screen.getByRole('button', { name: 'Aktion' })).toBeInTheDocument();
  });
});
