aboutsummaryrefslogtreecommitdiff
path: root/js/tests
diff options
context:
space:
mode:
authorJohann-S <[email protected]>2019-03-27 13:37:04 +0100
committerXhmikosR <[email protected]>2019-03-27 14:37:04 +0200
commit1752addadfbb538f0f1bfb1ed5792a0c162b1a3b (patch)
tree5f205a6aaf4edac615678a8000257e56f73a3e09 /js/tests
parent3c3ed3ff05b57c03b2c01ee38ece93b011afd329 (diff)
downloadbootstrap-1752addadfbb538f0f1bfb1ed5792a0c162b1a3b.tar.xz
bootstrap-1752addadfbb538f0f1bfb1ed5792a0c162b1a3b.zip
Reset carousel touch delta x to prevent click transformation in swipe (#28558)
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/unit/carousel.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/js/tests/unit/carousel.js b/js/tests/unit/carousel.js
index 02a0c8a77..f92d87c61 100644
--- a/js/tests/unit/carousel.js
+++ b/js/tests/unit/carousel.js
@@ -1153,7 +1153,7 @@ $(function () {
}
document.documentElement.ontouchstart = $.noop
- assert.expect(3)
+ assert.expect(4)
Simulator.setType('pointer')
var $styles = $(stylesCarousel).appendTo('head')
@@ -1182,6 +1182,7 @@ $(function () {
assert.ok(true, 'slid event fired')
assert.ok(!$item.hasClass('active'))
assert.ok(spy.called)
+ assert.strictEqual(carousel.touchDeltaX, 0)
$styles.remove()
delete document.documentElement.ontouchstart
done()
@@ -1195,7 +1196,7 @@ $(function () {
})
QUnit.test('should allow swipeleft and call next with touch events', function (assert) {
- assert.expect(3)
+ assert.expect(4)
clearPointerEvents()
Simulator.setType('touch')
document.documentElement.ontouchstart = $.noop
@@ -1225,6 +1226,7 @@ $(function () {
assert.ok(true, 'slid event fired')
assert.ok(!$item.hasClass('active'))
assert.ok(spy.called)
+ assert.strictEqual(carousel.touchDeltaX, 0)
restorePointerEvents()
delete document.documentElement.ontouchstart
done()