mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-30 22:52:24 +01:00
Update tests to check for noop
to be removed
This commit is contained in:
parent
5f946d3a86
commit
bac0b0c899
@ -1,5 +1,6 @@
|
||||
import Dropdown from '../../src/dropdown'
|
||||
import EventHandler from '../../src/dom/event-handler'
|
||||
import { noop } from '../../src/util'
|
||||
|
||||
/** Test helpers */
|
||||
import { getFixture, clearFixture, createEvent, jQueryMock } from '../helpers/fixture'
|
||||
@ -252,7 +253,7 @@ describe('Dropdown', () => {
|
||||
btnDropdown.addEventListener('shown.bs.dropdown', () => {
|
||||
expect(btnDropdown.classList.contains('show')).toEqual(true)
|
||||
expect(btnDropdown.getAttribute('aria-expanded')).toEqual('true')
|
||||
expect(EventHandler.on).toHaveBeenCalled()
|
||||
expect(EventHandler.on).toHaveBeenCalledWith(jasmine.any(Object), 'mouseover', noop)
|
||||
|
||||
dropdown.toggle()
|
||||
})
|
||||
@ -260,7 +261,7 @@ describe('Dropdown', () => {
|
||||
btnDropdown.addEventListener('hidden.bs.dropdown', () => {
|
||||
expect(btnDropdown.classList.contains('show')).toEqual(false)
|
||||
expect(btnDropdown.getAttribute('aria-expanded')).toEqual('false')
|
||||
expect(EventHandler.off).toHaveBeenCalled()
|
||||
expect(EventHandler.off).toHaveBeenCalledWith(jasmine.any(Object), 'mouseover', noop)
|
||||
|
||||
document.documentElement.ontouchstart = defaultValueOnTouchStart
|
||||
done()
|
||||
|
@ -450,7 +450,7 @@ describe('Tooltip', () => {
|
||||
|
||||
tooltipEl.addEventListener('shown.bs.tooltip', () => {
|
||||
expect(document.querySelector('.tooltip')).not.toBeNull()
|
||||
expect(EventHandler.on).toHaveBeenCalled()
|
||||
expect(EventHandler.on).toHaveBeenCalledWith(jasmine.any(Object), 'mouseover', noop)
|
||||
document.documentElement.ontouchstart = undefined
|
||||
done()
|
||||
})
|
||||
@ -889,7 +889,7 @@ describe('Tooltip', () => {
|
||||
|
||||
tooltipEl.addEventListener('hidden.bs.tooltip', () => {
|
||||
expect(document.querySelector('.tooltip')).toBeNull()
|
||||
expect(EventHandler.off).toHaveBeenCalled()
|
||||
expect(EventHandler.off).toHaveBeenCalledWith(jasmine.any(Object), 'mouseover', noop)
|
||||
document.documentElement.ontouchstart = undefined
|
||||
done()
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user