From 0d4213bde39bb4f2e2bc5a0df699dad82780efa3 Mon Sep 17 00:00:00 2001 From: GeoSot Date: Fri, 10 Sep 2021 02:17:28 +0300 Subject: Carousel: move repeated code to a method --- js/tests/unit/carousel.spec.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'js/tests') diff --git a/js/tests/unit/carousel.spec.js b/js/tests/unit/carousel.spec.js index ce9cd0fbc..7b58b9de9 100644 --- a/js/tests/unit/carousel.spec.js +++ b/js/tests/unit/carousel.spec.js @@ -851,12 +851,12 @@ describe('Carousel', () => { const carousel = new Carousel(carouselEl) spyOn(carousel, 'cycle') - spyOn(window, 'clearInterval') + spyOn(carousel, '_clearInterval') carousel.pause() expect(carousel.cycle).toHaveBeenCalledWith(true) - expect(window.clearInterval).toHaveBeenCalled() + expect(carousel._clearInterval).toHaveBeenCalled() expect(carousel._isPaused).toBeTrue() }) @@ -877,12 +877,12 @@ describe('Carousel', () => { const carousel = new Carousel(carouselEl) spyOn(carousel, 'cycle') - spyOn(window, 'clearInterval') + spyOn(carousel, '_clearInterval') carousel.pause() expect(carousel.cycle).not.toHaveBeenCalled() - expect(window.clearInterval).toHaveBeenCalled() + expect(carousel._clearInterval).toHaveBeenCalled() expect(carousel._isPaused).toBeTrue() }) @@ -903,11 +903,11 @@ describe('Carousel', () => { const carousel = new Carousel(carouselEl) const event = createEvent('mouseenter') - spyOn(window, 'clearInterval') + spyOn(carousel, '_clearInterval') carousel.pause(event) - expect(window.clearInterval).toHaveBeenCalled() + expect(carousel._clearInterval).toHaveBeenCalled() expect(carousel._isPaused).toBeFalse() }) }) -- cgit v1.2.3