mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-13 17:14:04 +02:00
Add function type for popperConfig
option (#32882)
* Add function type for `popperConfig` option * Update .bundlewatch.config.json * copy edits Co-authored-by: XhmikosR <xhmikosr@gmail.com> Co-authored-by: Mark Otto <markdotto@gmail.com>
This commit is contained in:
@@ -156,6 +156,21 @@ describe('Tooltip', () => {
|
||||
|
||||
expect(popperConfig.placement).toEqual('left')
|
||||
})
|
||||
|
||||
it('should allow to pass config to Popper with `popperConfig` as a function', () => {
|
||||
fixtureEl.innerHTML = '<a href="#" rel="tooltip">'
|
||||
|
||||
const tooltipEl = fixtureEl.querySelector('a')
|
||||
const getPopperConfig = jasmine.createSpy('getPopperConfig').and.returnValue({ placement: 'left' })
|
||||
const tooltip = new Tooltip(tooltipEl, {
|
||||
popperConfig: getPopperConfig
|
||||
})
|
||||
|
||||
const popperConfig = tooltip._getPopperConfig('top')
|
||||
|
||||
expect(getPopperConfig).toHaveBeenCalled()
|
||||
expect(popperConfig.placement).toEqual('left')
|
||||
})
|
||||
})
|
||||
|
||||
describe('enable', () => {
|
||||
|
Reference in New Issue
Block a user