/** LITTER-JUVENILE-DETAILS: Jungtier-Felder (Farbschlag/Abgabe/Verstorben) im Wurf-Detail. */
import { de, expect, skipUnlessMock, test } from './fixtures'

const t = de.pages.litters

test('Jungtier-Liste zeigt Farbschlag, Abgabedatum, Abnehmer, Todesdatum und Todesursache', async ({
  page,
}) => {
  skipUnlessMock()
  await page.goto('/wuerfe/w-kruemel')
  await expect(page.getByRole('heading', { name: 'Wurf K' })).toBeVisible()

  // Krümel: Active, colorVarietyId cv-agouti → Farbschlag 'Agouti'
  const kruemelCard = page.getByRole('link', { name: /Krümel/ })
  await expect(kruemelCard).toBeVisible()
  await expect(kruemelCard).toContainText(`${t.detail.juvenileFields.colorVariety}: Agouti`)

  // Pippa: GivenAway, Gold, goHomeDate 2025-05-01, Abnehmer Familie Huber
  const pippaCard = page.getByRole('link', { name: /Pippa/ })
  await expect(pippaCard).toBeVisible()
  await expect(pippaCard).toContainText(`${t.detail.juvenileFields.colorVariety}: Gold`)
  await expect(pippaCard).toContainText(t.detail.juvenileFields.goHomeDate)
  await expect(pippaCard).toContainText(`${t.detail.juvenileFields.receiver}: Familie Huber`)

  // Benny: Deceased, no colorVarietyId, dateOfDeath + causeOfDeath
  const bennyCard = page.getByRole('link', { name: /Benny/ })
  await expect(bennyCard).toBeVisible()
  await expect(bennyCard).toContainText(t.detail.juvenileFields.dateOfDeath)
  await expect(bennyCard).toContainText(`${t.detail.juvenileFields.causeOfDeath}: Altersschwäche`)
})
