2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-11 18:02:28 +03:00

create a base component

This commit is contained in:
Johann-S
2019-09-04 17:58:29 +03:00
committed by XhmikosR
parent c63aebc86b
commit 9f6b342dc7
23 changed files with 229 additions and 113 deletions
+20
View File
@@ -1062,6 +1062,26 @@ describe('Carousel', () => {
})
})
describe('getInstance', () => {
it('should return carousel instance', () => {
fixtureEl.innerHTML = '<div></div>'
const div = fixtureEl.querySelector('div')
const carousel = new Carousel(div)
expect(Carousel.getInstance(div)).toEqual(carousel)
expect(Carousel.getInstance(div) instanceof Carousel).toEqual(true)
})
it('should return null when there is no carousel instance', () => {
fixtureEl.innerHTML = '<div></div>'
const div = fixtureEl.querySelector('div')
expect(Carousel.getInstance(div)).toEqual(null)
})
})
describe('jQueryInterface', () => {
it('should create a carousel', () => {
fixtureEl.innerHTML = '<div></div>'