diff options
| author | GeoSot <[email protected]> | 2021-10-12 15:48:19 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-10-12 15:48:19 +0300 |
| commit | db44392bda22f3d5319d2880c992f76d27d2a60c (patch) | |
| tree | c5ddda1258d34a1d26d59feeb564680c7510fef9 /js/tests | |
| parent | d7dec124ebd1d67e66cb195646cbd42980145158 (diff) | |
| download | bootstrap-db44392bda22f3d5319d2880c992f76d27d2a60c.tar.xz bootstrap-db44392bda22f3d5319d2880c992f76d27d2a60c.zip | |
Swipe: add test to ensure that it ignores `pinch` events (#35161)
Diffstat (limited to 'js/tests')
| -rw-r--r-- | js/tests/unit/util/swipe.spec.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/js/tests/unit/util/swipe.spec.js b/js/tests/unit/util/swipe.spec.js index 5690319ff..d6aeb17f6 100644 --- a/js/tests/unit/util/swipe.spec.js +++ b/js/tests/unit/util/swipe.spec.js @@ -151,6 +151,25 @@ describe('Swipe', () => { }) describe('Functionality on PointerEvents', () => { + it('should not allow pinch with touch events', () => { + Simulator.setType('touch') + clearPointerEvents() + deleteDocumentElementOntouchstart() + + const swipe = new Swipe(swipeEl) + spyOn(swipe, '_handleSwipe') + + mockSwipeGesture(swipeEl, { + pos: [300, 10], + deltaX: -300, + deltaY: 0, + touches: 2 + }) + + restorePointerEvents() + expect(swipe._handleSwipe).not.toHaveBeenCalled() + }) + it('should allow swipeRight and call "rightCallback" with pointer events', done => { if (!supportPointerEvent) { expect().nothing() |
