-
Notifications
You must be signed in to change notification settings - Fork 0
test: add updateDOM integration tests for focus/typing #34
Copy link
Copy link
Open
Labels
follow-upFollow-up task from PR reviewFollow-up task from PR reviewfrom-reviewIssue originated from PR reviewIssue originated from PR review
Description
Context
This follow-up task was identified during the review of PR #32.
Source PR: #32
PR Title: fix: skip patching focused form elements during DOM update
Suggested by: @Copilot (review comment)
Task Description
PR #32 added unit tests for shouldSkipUpdate but lacks integration tests that exercise the full updateDOM() path with morphdom. Add regression tests covering:
- Focused textarea is not modified during an update — type in a textarea, trigger updateDOM with server content, verify textarea value and cursor position are preserved
- After blur, server updates apply again — focus a textarea, trigger update (skipped), blur, trigger another update, verify server content is applied
- Unfocused textarea
.valueis updated from server-rendered content — verify theonElUpdatedtextContent→value sync works for dirty textareas
Implementation notes
- These tests will need to instantiate
LiveTemplateClientor at minimum callupdateDOMdirectly with morphdom - May need to mock WebSocket transport
- Should use real DOM focus/blur (not private field mutation)
This issue was automatically created from PR review comments.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
follow-upFollow-up task from PR reviewFollow-up task from PR reviewfrom-reviewIssue originated from PR reviewIssue originated from PR review