/** QA-1: Grundnavigation — alle Bereiche erreichbar (Smartphone: „Mehr“-Blatt). */
import { de, expect, gotoSection, test } from './fixtures'

test('alle Bereiche sind über die Navigation erreichbar', async ({ page }) => {
  await page.goto('/')
  await expect(page.getByRole('heading', { name: de.app.title })).toBeVisible()
  await expect(page.getByRole('heading', { name: de.pages.gerbils.title, exact: true })).toBeVisible()

  await gotoSection(page, de.nav.gerbils)
  await expect(page.getByRole('heading', { name: de.pages.gerbils.title, exact: true })).toBeVisible()

  await gotoSection(page, de.nav.litters)
  await expect(page.getByRole('heading', { name: de.pages.litters.title, exact: true })).toBeVisible()

  await gotoSection(page, de.nav.genetics)
  await expect(page.getByRole('heading', { name: de.pages.genetik.title, exact: true })).toBeVisible()

  // Sekundärbereiche (auf dem Smartphone hinter „Mehr“)
  await gotoSection(page, de.nav.enclosures)
  await expect(page.getByRole('heading', { name: de.pages.becken.title, exact: true })).toBeVisible()

  await gotoSection(page, de.nav.contacts)
  await expect(page.getByRole('heading', { name: de.pages.kontakte.title, exact: true })).toBeVisible()

  await gotoSection(page, de.nav.statistics)
  await expect(page.getByRole('heading', { name: de.pages.statistik.title })).toBeVisible()
})

test('unbekannte Route zeigt die deutsche 404-Seite', async ({ page }) => {
  await page.goto('/diese-seite-gibt-es-nicht')
  await expect(page.getByText(de.pages.notFound.message)).toBeVisible()
  await page.getByRole('link', { name: de.pages.notFound.backHome }).click()
  await expect(page.getByRole('heading', { name: de.pages.gerbils.title, exact: true })).toBeVisible()
})
