Skip to content

Commit

Permalink
Merge branch 'main' into main-his-a11y-0-2-alt
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahiss authored Sep 19, 2024
2 parents c4c5cef + 9518929 commit 74ccc87
Show file tree
Hide file tree
Showing 10 changed files with 1,030 additions and 1,878 deletions.
2 changes: 1 addition & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const config = {
options: {},
},
docs: {
defaultName: 'Docs',
defaultName: 'Docs'
}
};
export default config;
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
Loading

0 comments on commit 74ccc87

Please sign in to comment.