1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-13 17:14:04 +02: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

View File

@@ -1030,6 +1030,26 @@ describe('Tooltip', () => {
})
})
describe('getInstance', () => {
it('should return tooltip instance', () => {
fixtureEl.innerHTML = '<div></div>'
const div = fixtureEl.querySelector('div')
const alert = new Tooltip(div)
expect(Tooltip.getInstance(div)).toEqual(alert)
expect(Tooltip.getInstance(div) instanceof Tooltip).toEqual(true)
})
it('should return null when there is no tooltip instance', () => {
fixtureEl.innerHTML = '<div></div>'
const div = fixtureEl.querySelector('div')
expect(Tooltip.getInstance(div)).toEqual(null)
})
})
describe('jQueryInterface', () => {
it('should create a tooltip', () => {
fixtureEl.innerHTML = '<div></div>'