mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-12 08:34:08 +02:00
rewrite button unit tests
This commit is contained in:
@@ -18,3 +18,21 @@ export const clearFixture = () => {
|
||||
|
||||
fixtureEl.innerHTML = ''
|
||||
}
|
||||
|
||||
export const createEvent = (eventName, params) => {
|
||||
params = params || {}
|
||||
const e = document.createEvent('Event')
|
||||
|
||||
e.initEvent(eventName, Boolean(params.bubbles), Boolean(params.cancelable))
|
||||
return e
|
||||
}
|
||||
|
||||
export const jQueryMock = {
|
||||
elements: undefined,
|
||||
fn: {},
|
||||
each(fn) {
|
||||
this.elements.forEach(el => {
|
||||
fn.call(el)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user