Skip to content

feat(remote-cursors): add branch-coverage tests for remote-cursors.tsx - #574

Merged
d-oit merged 1 commit into
mainfrom
feat/remote-cursors-branch-coverage
Jul 31, 2026
Merged

feat(remote-cursors): add branch-coverage tests for remote-cursors.tsx#574
d-oit merged 1 commit into
mainfrom
feat/remote-cursors-branch-coverage

Conversation

@d-oit

@d-oit d-oit commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Branch Coverage: remote-cursors.tsx (33.33% -> ~80% branches)

What

5 targeted tests covering the untested branches in the CursorTracker effect handlers.

Coverage Areas

Area Tests
Mouse move handler computes offset coordinates via getBoundingClientRect -> setCursor(50, 50)
Text selection valid selection -> select(startOffset, endOffset, text)
Null selection getSelection() null -> clearSelect
No ranges rangeCount 0 -> clearSelect
Whitespace text trim() empty -> clearSelect

Notes

  • Uses vi.hoisted() for the useCursors mock (avoids Vitest TDZ on hoisted vi.mock references)
  • mousemove test mocks getBoundingClientRect via spyOn; selection tests mock window.getSelection

@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
do-knowledge-studio Ready Ready Preview, v0 Jul 31, 2026 9:09am

@github-actions github-actions Bot added config tests Related to automated/manual tests labels Jul 31, 2026
@codacy-production

Copy link
Copy Markdown
Contributor

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@d-oit
d-oit merged commit 7426c15 into main Jul 31, 2026
23 checks passed
@d-oit
d-oit deleted the feat/remote-cursors-branch-coverage branch July 31, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config tests Related to automated/manual tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant