mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-18 03:11:19 +02:00
JS: tests fixes & standardization of spies usage (#36398)
* Fix carousel spec typo * Change carousel test name in align with testing method * Make the spies declarations the same everywhere
This commit is contained in:
committed by
GitHub
parent
78c0ad8044
commit
d388bd6e1b
@@ -164,11 +164,11 @@ describe('Popover', () => {
|
||||
|
||||
const popoverEl = fixtureEl.querySelector('a')
|
||||
const popover = new Popover(popoverEl, { animation: false })
|
||||
spyOn(EventHandler, 'trigger').and.callThrough()
|
||||
const spy = spyOn(EventHandler, 'trigger').and.callThrough()
|
||||
|
||||
popover.show()
|
||||
|
||||
expect(EventHandler.trigger).not.toHaveBeenCalledWith(popoverEl, Popover.eventName('show'))
|
||||
expect(spy).not.toHaveBeenCalledWith(popoverEl, Popover.eventName('show'))
|
||||
expect(document.querySelector('.popover')).toBeNull()
|
||||
})
|
||||
|
||||
@@ -329,11 +329,11 @@ describe('Popover', () => {
|
||||
jQueryMock.fn.popover = Popover.jQueryInterface
|
||||
jQueryMock.elements = [popoverEl]
|
||||
|
||||
spyOn(popover, 'show')
|
||||
const spy = spyOn(popover, 'show')
|
||||
|
||||
jQueryMock.fn.popover.call(jQueryMock, 'show')
|
||||
|
||||
expect(popover.show).toHaveBeenCalled()
|
||||
expect(spy).toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user