STAMMBAUM-FULLDATE: volles Geburtsdatum auf Knoten-Karten (formatDate statt slice 4) + e2e

This commit is contained in:
2026-06-07 02:47:12 +02:00
parent c45bcc99f0
commit bfc90f8581
2 changed files with 10 additions and 2 deletions

View File

@@ -137,3 +137,11 @@ test('Kein Würfe-Panel wenn Wurzeltier keine Würfe hat (STAMMBAUM-LITTERS)', a
await expect(page.locator('.pedigree-card').first()).toBeVisible()
await expect(page.locator('.stammbaum-litters-panel')).not.toBeVisible()
})
test('Knoten-Karte zeigt volles Geburtsdatum (STAMMBAUM-FULLDATE)', async ({ page }) => {
skipUnlessMock()
// Krümel: dateOfBirth '2025-03-12' → formatDate → '12.03.2025'
await page.goto('/rennmaeuse/kruemel/stammbaum')
await expect(page.locator('.pedigree-card').first()).toBeVisible()
await expect(page.locator('.pedigree-card__year').first()).toContainText('12.03.2025')
})

View File

@@ -379,7 +379,7 @@ function PedigreeCard({
const t = de.pages.stammbaum
const g = node.gerbil
const chip = farbschlag ? chipColorFor(farbschlag) : null
const year = g.dateOfBirth ? g.dateOfBirth.slice(0, 4) : null
const dob = g.dateOfBirth ? formatDate(g.dateOfBirth) : null
return (
<div
className={isRoot ? 'pedigree-card pedigree-card--root' : 'pedigree-card'}
@@ -410,7 +410,7 @@ function PedigreeCard({
{farbschlag}
</span>
)}
{year && <span className="pedigree-card__year">* {year}</span>}
{dob && <span className="pedigree-card__year">* {dob}</span>}
</div>
{node.expandable && (
<button