aboutsummaryrefslogtreecommitdiff
path: root/js/tests
diff options
context:
space:
mode:
authorGeoSot <[email protected]>2021-09-10 02:17:28 +0300
committerXhmikosR <[email protected]>2021-12-21 17:37:24 +0200
commit0d4213bde39bb4f2e2bc5a0df699dad82780efa3 (patch)
tree2b76fde2fd30ef635c4d1985dbdaa3a17f9c0aea /js/tests
parentb8ee68cfa0f3516dc55aec5da6d7e43e2705f402 (diff)
downloadbootstrap-0d4213bde39bb4f2e2bc5a0df699dad82780efa3.tar.xz
bootstrap-0d4213bde39bb4f2e2bc5a0df699dad82780efa3.zip
Carousel: move repeated code to a method
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/unit/carousel.spec.js12
1 files changed, 6 insertions, 6 deletions
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()
})
})