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

triggering cancelable event causes error #1472

Closed
sjahns opened this issue Mar 16, 2020 · 2 comments
Closed

triggering cancelable event causes error #1472

sjahns opened this issue Mar 16, 2020 · 2 comments

Comments

@sjahns
Copy link

sjahns commented Mar 16, 2020

Version

1.0.0-beta.32

Reproduction link

https://github.com/sjahns/vue-test-utils-issue-event-cancelable

Steps to reproduce

npm install

npm run test:unit

What is expected?

It should not cause an error

What is actually happening?

It does end in an error


This happens due to createDOMEvent() setting all given options on the event object. But cancelable is read only.

To me it looks like the event is created correctly with cancelable:false but createDOMEvent() will also try to set the property.

I found this while testing a component which does:

if(event.cancelable) {
event.preventDefault();
}

@lmiller1990
Copy link
Member

I (think) we have a PR in progress for this #1460

@dobromir-hristov
Copy link
Contributor

Closing as #1460 is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants