FEAT-13: e2e an strukturierte Kontaktfelder angepasst + 2 Abdeckungstests (Patch von Oscar, e2e-Owner)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-06 07:53:57 +02:00
parent d8ccb451d9
commit be62e785db
2 changed files with 21 additions and 4 deletions

View File

@@ -75,13 +75,29 @@ test.describe('Kontakte', () => {
await page.getByRole('link', { name: tk.newButton }).click()
const name = uniqueName('Kontakt')
await page.getByLabel(`${tk.fields.name} *`).fill(name)
await page.getByLabel(tk.fields.contactInfo).fill('test@example.de')
// FEAT-13: strukturierte Felder statt Freitext-Kontaktdaten
await page.getByLabel(tk.fields.email).fill('test@example.de')
await page.getByLabel(tk.fields.phone).fill('0151 9876543')
await page.getByRole('button', { name: tk.form.save, exact: true }).click()
await expect(page.getByRole('heading', { name })).toBeVisible()
await expect(page.getByText(tk.linked.empty)).toBeVisible()
// die gespeicherten Felder erscheinen auf der Detailseite
await expect(page.getByText('test@example.de')).toBeVisible()
await expect(page.getByText('0151 9876543')).toBeVisible()
acceptNextDialog(page)
await page.getByRole('button', { name: tk.delete.action }).click()
await expect(page.getByRole('heading', { name: tk.title, exact: true })).toBeVisible()
})
// FEAT-13: Abdeckung der neuen strukturierten Kontaktfelder
test('Detail zeigt E-Mail, Telefon und Adresse mit deutschen Beschriftungen', async ({ page }) => {
skipUnlessMock()
await page.goto('/kontakte')
await page.getByRole('link', { name: /Zoohandlung Meier/ }).click()
await expect(page.getByText(tk.fields.email, { exact: true })).toBeVisible()
await expect(page.getByText('meier@example.de')).toBeVisible()
await expect(page.getByText(tk.fields.address, { exact: true })).toBeVisible()
await expect(page.getByText('Hauptstraße 1, 12345 Musterstadt')).toBeVisible()
})
})

View File

@@ -105,10 +105,11 @@ export function seedDb(): MockDb {
{ id: 'enc-leer', name: 'Quarantänebecken', notes: null },
]
// FEAT-13: contactInfo (Freitext) wurde durch strukturierte Felder ersetzt.
const contacts: Contact[] = [
{ id: 'con-meier', name: 'Zoohandlung Meier', contactInfo: 'meier@example.de', notes: null },
{ id: 'con-huber', name: 'Familie Huber', contactInfo: '0151 2345678', notes: null },
{ id: 'con-frei', name: 'Züchterin Frei', contactInfo: null, notes: 'unverknüpft' },
{ id: 'con-meier', name: 'Zoohandlung Meier', email: 'meier@example.de', phone: null, address: 'Hauptstraße 1, 12345 Musterstadt', notes: null },
{ id: 'con-huber', name: 'Familie Huber', email: null, phone: '0151 2345678', address: null, notes: null },
{ id: 'con-frei', name: 'Züchterin Frei', email: null, phone: null, address: null, notes: 'unverknüpft' },
]
const colorVarieties = [