import { render, screen } from '@testing-library/svelte';
import { describe, expect, it } from 'vitest';
import HomePage from './+page.svelte';
import { createHomepageRouteData } from '../test/fixtures';

describe('home page route', () => {
  it('renders the homepage sections and SEO metadata', () => {
    render(HomePage, {
      data: createHomepageRouteData()
    });

    expect(screen.getAllByText("Your Dog's Day!").length).toBeGreaterThan(0);
    expect(document.body.textContent).toContain('Happy pets,');
    expect(screen.getByText('Locations & Hours')).toBeInTheDocument();
    expect(screen.queryByLabelText(/General enquiry/i)).not.toBeInTheDocument();
    expect(document.title).toBe('Home | Auckland Dog Walking | Goodwalk');
    expect(document.head.innerHTML).toContain('FAQPage');
    expect(document.head.innerHTML).toContain('https://www.goodwalk.co.nz/images/auckland-dog-walking-happy-dog-hero.png');
  });
});
