Skip to content

Commit

Permalink
fix coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ph-fritsche committed Oct 24, 2021
1 parent 835801f commit 37490aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/pointer/pointerMove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export async function pointerMove(
Math.min(selectionRange.start, selectionFocus.offset),
Math.max(selectionRange.end, selectionFocus.offset),
)
} else if ('setEnd' in selectionRange) {
} else /* istanbul ignore else */ if ('setEnd' in selectionRange) {
const range = selectionRange.cloneRange()
const cmp = selectionRange.comparePoint(
selectionFocus.node,
Expand Down
5 changes: 5 additions & 0 deletions tests/pointer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,11 @@ describe('mousedown moves selection', () => {

expect(element).toHaveProperty('selectionStart', 4)
expect(element).toHaveProperty('selectionEnd', 10)

userEvent.pointer({}, {pointerState})

expect(element).toHaveProperty('selectionStart', 4)
expect(element).toHaveProperty('selectionEnd', 11)
})

test('selection is moved on non-input elements', () => {
Expand Down

0 comments on commit 37490aa

Please sign in to comment.