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

describe('EmptyState', () => {
  it('renders title and description', () => {
    render(<EmptyState title="No orders yet" description="They'll show up here." />);

    expect(screen.getByText('No orders yet')).toBeInTheDocument();
    expect(screen.getByText("They'll show up here.")).toBeInTheDocument();
  });

  it('renders action when provided', () => {
    render(
      <EmptyState
        title="No listings"
        description="Create your first listing."
        action={<button>New item</button>}
      />,
    );

    expect(screen.getByRole('button', { name: 'New item' })).toBeInTheDocument();
  });
});
