Skip to content

Commit

Permalink
modify test to fire touch event of slider
Browse files Browse the repository at this point in the history
  • Loading branch information
sus-yoshikane-t committed Sep 17, 2024
1 parent 1ae5624 commit 02fe81f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/Range.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,16 @@ describe('Range', () => {
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, {
const touchMove = createEvent.touchMove(container.getElementsByClassName(element)[0], {
touches: [{}],
targetTouches: [{}],
});
(touchMove as any).touches[0].pageX = end;
(touchMove as any).targetTouches[0].pageX = end;
fireEvent(document, touchMove);
fireEvent(container.getElementsByClassName(element)[0], touchMove);
}

it('should render Range with correct DOM structure', () => {
Expand Down

0 comments on commit 02fe81f

Please sign in to comment.