Skip to content

Commit

Permalink
Merge branch 'main' into main-jd-improve-order-utility-management
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-deramond authored Sep 12, 2024
2 parents eb56ab3 + fecd219 commit afb656f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
1 change: 0 additions & 1 deletion js/src/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ class Tooltip extends BaseComponent {
return
}

this._activeTrigger.click = !this._activeTrigger.click
if (this._isShown()) {
this._leave()
return
Expand Down
20 changes: 20 additions & 0 deletions js/tests/unit/popover.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,26 @@ describe('Popover', () => {
})

describe('show', () => {
it('should toggle a popover after show', () => {
return new Promise(resolve => {
fixtureEl.innerHTML = '<a href="#" title="Popover" data-bs-content="https://twitter.com/getbootstrap">BS twitter</a>'

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 = '<a href="#" title="Popover" data-bs-content="https://twitter.com/getbootstrap">BS twitter</a>'
Expand Down

0 comments on commit afb656f

Please sign in to comment.