test: add auto-focus test for Briefwechsel hero typeahead #189
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?
Context
The
CorrespondenzHerocomponent auto-focuses the PersonTypeahead input on mount viaonMount+tick()+element.focus(). This is a key UX requirement from #179 (users shouldn't have to click).Currently there's no automated test for this behaviour — it was deferred during PR #186 because
document.activeElementassertions are unreliable in headless Playwright withvitest-browser-svelte.Proposed change
Investigate whether a reliable focus test can be written, e.g.:
await expect(document.activeElement?.id).toBe('senderId-search')after render/briefwechselIf it remains flaky, document the manual verification step in the test file as a comment.
Origin
Flagged by @saraholt during PR #186 review.