diff --git a/js/src/tooltip.js b/js/src/tooltip.js index 92d455349336..097477f7a1a8 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -160,7 +160,6 @@ class Tooltip extends BaseComponent { return } - this._activeTrigger.click = !this._activeTrigger.click if (this._isShown()) { this._leave() return diff --git a/js/tests/unit/popover.spec.js b/js/tests/unit/popover.spec.js index ba38ebe06629..1c81ba79279c 100644 --- a/js/tests/unit/popover.spec.js +++ b/js/tests/unit/popover.spec.js @@ -56,6 +56,26 @@ describe('Popover', () => { }) describe('show', () => { + it('should toggle a popover after show', () => { + return new Promise(resolve => { + fixtureEl.innerHTML = 'BS twitter' + + const popoverEl = fixtureEl.querySelector('a') + const popover = new Popover(popoverEl) + + popoverEl.addEventListener('shown.bs.popover', () => { + expect(document.querySelector('.popover')).not.toBeNull() + popover.toggle() + }) + popoverEl.addEventListener('hidden.bs.popover', () => { + expect(document.querySelector('.popover')).toBeNull() + resolve() + }) + + popover.show() + }) + }) + it('should show a popover', () => { return new Promise(resolve => { fixtureEl.innerHTML = 'BS twitter'