Skip to content

Commit ebcf945

Browse files
Test cancelled touch moves before the next gesture
1 parent a526a9b commit ebcf945

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎tests/touch.test.js‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,14 @@ describe('List.Touch', () => {
138138
const cancelEvent = new Event('touchcancel');
139139
element.dispatchEvent(cancelEvent);
140140

141+
act(() => {
142+
const cancelledMove = new Event('touchmove');
143+
cancelledMove.touches = [{ pageY: 90 }];
144+
element.dispatchEvent(cancelledMove);
145+
jest.runAllTimers();
146+
});
147+
expect(container.querySelector('ul').scrollTop).toBe(0);
148+
141149
// 3. User touches again
142150
act(() => {
143151
const touchStart2 = new Event('touchstart');

0 commit comments

Comments
 (0)