1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-13 00:54:04 +02:00

Update to popper.js v2.x

This commit is contained in:
Johann-S
2020-06-19 11:17:01 +03:00
committed by XhmikosR
parent 5f89ea3a0f
commit adfdf7160b
26 changed files with 145 additions and 297 deletions

View File

@@ -483,24 +483,6 @@ describe('Tooltip', () => {
tooltip.show()
})
it('should show a tooltip with offset as a function', done => {
fixtureEl.innerHTML = '<a href="#" rel="tooltip" title="Another tooltip">'
const spy = jasmine.createSpy('offset').and.returnValue({})
const tooltipEl = fixtureEl.querySelector('a')
const tooltip = new Tooltip(tooltipEl, {
offset: spy
})
tooltipEl.addEventListener('shown.bs.tooltip', () => {
expect(document.querySelector('.tooltip')).toBeDefined()
expect(spy).toHaveBeenCalled()
done()
})
tooltip.show()
})
it('should show a tooltip without the animation', done => {
fixtureEl.innerHTML = '<a href="#" rel="tooltip" title="Another tooltip">'
@@ -789,18 +771,18 @@ describe('Tooltip', () => {
})
describe('update', () => {
it('should call popper schedule update', done => {
it('should call popper update', done => {
fixtureEl.innerHTML = '<a href="#" rel="tooltip" title="Another tooltip">'
const tooltipEl = fixtureEl.querySelector('a')
const tooltip = new Tooltip(tooltipEl)
tooltipEl.addEventListener('shown.bs.tooltip', () => {
spyOn(tooltip._popper, 'scheduleUpdate')
spyOn(tooltip._popper, 'update')
tooltip.update()
expect(tooltip._popper.scheduleUpdate).toHaveBeenCalled()
expect(tooltip._popper.update).toHaveBeenCalled()
done()
})