mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-08 06:36:33 +02:00
Swipe: add test to ensure that it ignores pinch
events (#35161)
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user