From e1f5d819c73ad66e6ec0480e75e5e08c815a633e Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sun, 29 Mar 2020 09:59:54 +0300 Subject: [PATCH] Remove `MSPointerEvent` and `ms-touch-action` in tests (#30463) --- js/src/carousel.js | 2 +- js/tests/unit/carousel.spec.js | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/js/src/carousel.js b/js/src/carousel.js index 509f7ca9d8..3020974d38 100644 --- a/js/src/carousel.js +++ b/js/src/carousel.js @@ -118,7 +118,7 @@ class Carousel { this._element = element this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element) this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0 - this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent) + this._pointerEvent = Boolean(window.PointerEvent) this._addEventListeners() Data.setData(element, DATA_KEY, this) diff --git a/js/tests/unit/carousel.spec.js b/js/tests/unit/carousel.spec.js index a163f9ae41..be32d19d9b 100644 --- a/js/tests/unit/carousel.spec.js +++ b/js/tests/unit/carousel.spec.js @@ -5,12 +5,11 @@ import EventHandler from '../../src/dom/event-handler' import { getFixture, clearFixture, createEvent, jQueryMock } from '../helpers/fixture' describe('Carousel', () => { - const { Simulator, PointerEvent, MSPointerEvent } = window - const originWinPointerEvent = PointerEvent || MSPointerEvent - const supportPointerEvent = Boolean(PointerEvent || MSPointerEvent) + const { Simulator, PointerEvent } = window + const originWinPointerEvent = PointerEvent + const supportPointerEvent = Boolean(PointerEvent) - window.MSPointerEvent = null - const cssStyleCarousel = '.carousel.pointer-event { -ms-touch-action: none; touch-action: none; }' + const cssStyleCarousel = '.carousel.pointer-event { touch-action: none; }' const stylesCarousel = document.createElement('style') stylesCarousel.type = 'text/css'