mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-17 19:21:23 +03:00
Ability to add custom class in tooltip/popover (#32217)
Porting of #31834 to main. Co-authored-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
@@ -116,6 +116,22 @@ describe('Popover', () => {
|
||||
|
||||
popover.show()
|
||||
})
|
||||
|
||||
it('should show a popover with provided custom class', done => {
|
||||
fixtureEl.innerHTML = '<a href="#" title="Popover" data-bs-content="https://twitter.com/getbootstrap" data-bs-custom-class="custom-class">BS twitter</a>'
|
||||
|
||||
const popoverEl = fixtureEl.querySelector('a')
|
||||
const popover = new Popover(popoverEl)
|
||||
|
||||
popoverEl.addEventListener('shown.bs.popover', () => {
|
||||
const tip = document.querySelector('.popover')
|
||||
expect(tip).toBeDefined()
|
||||
expect(tip.classList.contains('custom-class')).toBeTrue()
|
||||
done()
|
||||
})
|
||||
|
||||
popover.show()
|
||||
})
|
||||
})
|
||||
|
||||
describe('hide', () => {
|
||||
|
||||
Reference in New Issue
Block a user