Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(test-utils): fix cancelable attribute in dom events #1460

Merged
merged 1 commit into from Mar 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/test-utils/src/create-dom-event.js
Expand Up @@ -32,7 +32,7 @@ function getOptions(eventParams) {
...options, // What the user passed in as the second argument to #trigger

bubbles: meta.bubbles,
meta: meta.cancelable,
cancelable: meta.cancelable,

// Any derived options should go here
keyCode,
Expand Down
11 changes: 11 additions & 0 deletions test/specs/create-dom-event.spec.js
@@ -0,0 +1,11 @@
import createDOMEvent from '../../packages/test-utils/src/create-dom-event'
import { isRunningPhantomJS } from '~resources/utils'
import { itDoNotRunIf } from 'conditional-specs'

describe('createDOMEvent', () => {
itDoNotRunIf(isRunningPhantomJS, 'returns cancelable event', () => {
const event = createDOMEvent('click', {})
expect(event.bubbles).to.equal(true)
expect(event.cancelable).to.equal(true)
})
})