From 26246f92ab1ad9d468a5679e7c1c8f85c4d152f4 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Thu, 9 Sep 2021 15:29:53 +0300 Subject: tests: use the util noop function --- js/tests/unit/carousel.spec.js | 22 +++++++++++----------- js/tests/unit/dropdown.spec.js | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/js/tests/unit/carousel.spec.js b/js/tests/unit/carousel.spec.js index a933f1eda..02614323e 100644 --- a/js/tests/unit/carousel.spec.js +++ b/js/tests/unit/carousel.spec.js @@ -3,7 +3,7 @@ import EventHandler from '../../src/dom/event-handler' /** Test helpers */ import { clearFixture, createEvent, getFixture, jQueryMock } from '../helpers/fixture' -import * as util from '../../src/util' +import { isRTL, noop } from '../../src/util' describe('Carousel', () => { const { Simulator, PointerEvent } = window @@ -331,7 +331,7 @@ describe('Carousel', () => { // Headless browser does not support touch events, so need to fake it // to test that touch events are add properly. - document.documentElement.ontouchstart = () => {} + document.documentElement.ontouchstart = noop const carousel = new Carousel(carouselEl) expect(carousel._addTouchEventListeners).toHaveBeenCalled() @@ -344,7 +344,7 @@ describe('Carousel', () => { return } - document.documentElement.ontouchstart = () => {} + document.documentElement.ontouchstart = noop document.head.append(stylesCarousel) Simulator.setType('pointer') @@ -389,7 +389,7 @@ describe('Carousel', () => { return } - document.documentElement.ontouchstart = () => {} + document.documentElement.ontouchstart = noop document.head.append(stylesCarousel) Simulator.setType('pointer') @@ -431,7 +431,7 @@ describe('Carousel', () => { it('should allow swiperight and call _slide (prev) with touch events', done => { Simulator.setType('touch') clearPointerEvents() - document.documentElement.ontouchstart = () => {} + document.documentElement.ontouchstart = noop fixtureEl.innerHTML = [ '