fix(import): address PR review concerns

- remove duplicate List import in AdminControllerTest
- derive skipped() from skippedFiles.size() — drop redundant int field
- use machine codes for SkippedFile.reason (INVALID_PDF_SIGNATURE, FILE_READ_ERROR)
- map reason codes to i18n strings in ImportStatusCard (de/en/es)
- replace raw amber Tailwind classes with warning semantic token
- fix <summary> accessibility: replace list-none with rotating chevron SVG
- replace <p> with <span> inside <summary> (phrasing content rule)
- extract setupOneValidOneFakeImport() helper — remove 3x copy-paste
- add lenient mock to short-file test for defensive coverage
- add IOException path test for isPdfMagicBytes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-05-18 14:45:21 +02:00
committed by marcel
parent 0451b6630c
commit 5587722800
8 changed files with 94 additions and 49 deletions

View File

@@ -140,9 +140,9 @@ describe('ImportStatusCard', () => {
processed: 10,
skipped: 3,
skippedFiles: [
{ filename: 'fake.pdf', reason: 'Keine gültige PDF-Signatur' },
{ filename: 'other.pdf', reason: 'Keine gültige PDF-Signatur' },
{ filename: 'tiny.pdf', reason: 'Keine gültige PDF-Signatur' }
{ filename: 'fake.pdf', reason: 'INVALID_PDF_SIGNATURE' },
{ filename: 'other.pdf', reason: 'INVALID_PDF_SIGNATURE' },
{ filename: 'tiny.pdf', reason: 'INVALID_PDF_SIGNATURE' }
]
}),
ontrigger: () => {}
@@ -160,7 +160,7 @@ describe('ImportStatusCard', () => {
statusCode: 'IMPORT_DONE',
processed: 5,
skipped: 1,
skippedFiles: [{ filename: 'fake.pdf', reason: 'Keine gültige PDF-Signatur' }]
skippedFiles: [{ filename: 'fake.pdf', reason: 'INVALID_PDF_SIGNATURE' }]
}),
ontrigger: () => {}
}