feat(import): RennmausPro-III-Backup-Importer (analyze+execute, Dedup, Fotos)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-22 22:43:19 +02:00
parent 5e14124322
commit 3ad276637c
19 changed files with 2620 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
/** RPRO3: RennmausPro-III-Import-Rubrik unter „Hilfe" — Auswerten → Import durchführen. */
import { de, expect, skipUnlessMock, test } from './fixtures'
const t = de.pages.rpro3Import
const h = de.hilfe
test('Hilfe verlinkt auf den RennmausPro-Import', async ({ page }) => {
skipUnlessMock()
await page.goto('/hilfe')
// Den Abschnitt aufklappen und dem Link folgen.
await page.getByText(h.sections.rpro3Import).click()
await page.getByRole('link', { name: new RegExp(h.rpro3Link.button) }).click()
await expect(page).toHaveURL(/\/hilfe\/rennmauspro-import$/)
await expect(page.getByRole('heading', { name: t.title })).toBeVisible()
})
test('Auswerten zeigt die Übersicht, danach importiert "Import durchführen"', async ({ page }) => {
skipUnlessMock()
await page.goto('/hilfe/rennmauspro-import')
// Auswerten ohne Datei ist deaktiviert.
const analyzeBtn = page.getByRole('button', { name: t.analyzeButton })
await expect(analyzeBtn).toBeDisabled()
// Eine (Pseudo-).backup-Datei auswählen.
await page.getByLabel(t.backupLabel).setInputFiles({
name: 'RennmausPro.backup',
mimeType: 'application/octet-stream',
buffer: Buffer.from('PK fake-zip'),
})
await expect(analyzeBtn).toBeEnabled()
await analyzeBtn.click()
// Auswertung erscheint (Zählungen + Abgleich).
await expect(page.getByRole('heading', { name: t.step2Title })).toBeVisible()
await expect(page.getByText(t.counts.ownAnimals)).toBeVisible()
await expect(page.getByText('303')).toBeVisible()
await expect(page.getByText(t.newCount(280))).toBeVisible()
// Mehrdeutige Namen sind aufklappbar.
await page.getByText(t.ambiguousTitle).click()
await expect(page.getByText('Merlin')).toBeVisible()
// Import durchführen.
await page.getByRole('button', { name: t.executeButton }).click()
await expect(page.getByRole('heading', { name: t.successTitle })).toBeVisible()
await expect(page.getByText('3694')).toBeVisible()
await expect(page.getByText(t.resultCounts.gerbils)).toBeVisible()
})