import { describe, it, expect } from 'vitest';
import { render, screen } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';
import LandingPage from './LandingPage';

function renderLanding() {
  return render(
    <MemoryRouter>
      <LandingPage />
    </MemoryRouter>,
  );
}

describe('LandingPage', () => {
  it('renders the Safnaturel heading', () => {
    renderLanding();
    expect(screen.getByRole('heading', { level: 1, name: /safnaturel/i })).toBeInTheDocument();
  });

  it('renders the subtitle', () => {
    renderLanding();
    expect(screen.getByText('Özel Tasarım Takılar')).toBeInTheDocument();
  });

  it('renders the logo', () => {
    renderLanding();
    expect(screen.getByRole('img', { name: /safnaturel logosu/i })).toBeInTheDocument();
  });

  it('renders the section heading', () => {
    renderLanding();
    expect(screen.getByRole('heading', { level: 2, name: /tasarım türü seçin/i })).toBeInTheDocument();
  });

  it('renders three category cards', () => {
    renderLanding();
    expect(screen.getByRole('button', { name: /bileklik tasarla/i })).toBeInTheDocument();
    expect(screen.getByRole('button', { name: /kolye tasarla/i })).toBeInTheDocument();
    expect(screen.getByRole('button', { name: /tesbih tasarla/i })).toBeInTheDocument();
  });
});
