test(enrich): E2E coverage for WhoWhenSection autofocus and upload cancel flow #268
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Background
Deferred during PR #267 review cycle 3 (Sara Holt's concerns).
Concern
Three behaviors in the enrich page upload/field flow have no automated test coverage:
WhoWhenSection autofocus conditional logic —
autofocus={!initialDateIso}on date input,autofocus={!!initialDateIso}on sender input. The unit test approach (checkingautofocusattribute ordocument.activeElementin vitest-browser) proved unreliable because PersonTypeahead's internal initialization interferes with focus state in the test environment. Requires E2E testing where the full page renders in isolation.Upload cancel flow —
cancelUpload()callsabortController?.abort()and resetsisUploading. TheAbortErrorguard inhandleFile(if ((e as Error).name === 'AbortError') return;) is untested. This logic lives in+page.svelteand cannot easily be unit-tested in isolation.handleReplaceFile— extracts a file from the change event and delegates tohandleFile. The "Datei ersetzen" path is untested at unit level; requires E2E or integration testing against the full page.Why deferred
All three require either:
Both are architectural decisions that are out of scope for this PR.
Reference
PR: http://heim-nas:3005/marcel/familienarchiv/pulls/267