Skip to content

Commit

Permalink
modify test to use targetTouches
Browse files Browse the repository at this point in the history
  • Loading branch information
sus-yoshikane-t committed Sep 11, 2024
1 parent ede6915 commit 7643b38
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/Range.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,19 @@ describe('Range', () => {
) {
const touchStart = createEvent.touchStart(container.getElementsByClassName(element)[0], {
touches: [{}],
targetTouches: [{}],
});
(touchStart as any).touches[0].pageX = start;
(touchStart as any).targetTouches[0].pageX = start;
fireEvent(container.getElementsByClassName(element)[0], touchStart);

// Drag
const touchMove = createEvent.touchMove(document, {
touches: [{}],
targetTouches: [{}],
});
(touchMove as any).touches[0].pageX = end;
(touchMove as any).targetTouches[0].pageX = end;
fireEvent(document, touchMove);
}

Expand Down

0 comments on commit 7643b38

Please sign in to comment.