diff options
author | Johann-S <johann.servoire@gmail.com> | 2019-09-04 17:58:29 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2020-11-29 21:58:26 +0300 |
commit | 9f6b342dc710e4334b37ded90136efa1127a47cd (patch) | |
tree | cb5d8c8bddf356dd3f8c2289b99e9f9793fba6c7 /js/tests/unit/tooltip.spec.js | |
parent | c63aebc86ba05f0ebb420add653b80804c6a0cff (diff) |
create a base component
Diffstat (limited to 'js/tests/unit/tooltip.spec.js')
-rw-r--r-- | js/tests/unit/tooltip.spec.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/js/tests/unit/tooltip.spec.js b/js/tests/unit/tooltip.spec.js index da2abba314..36316b42f9 100644 --- a/js/tests/unit/tooltip.spec.js +++ b/js/tests/unit/tooltip.spec.js @@ -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>' |