-
Notifications
You must be signed in to change notification settings - Fork 264
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
Possible issue with dispatching events #886
Comments
@marina-mosti thank you for reporting this! This is how I'm working around this in yet-unreleased package const VTU = require('@vue/test-utils')
VTU.VueWrapper.prototype.attachNativeEventListener = () => {} |
Hey @xanf awesome!! Thanks for taking a look and the hack 😄 |
@xanf beat me to it with the double click explanation. Is there any obvious explanation for the first problem? "... The event for the keyboard event never fires ...". Also, I wonder if we can just do |
Reopening because even with @xanf 's fix, the keyboard event is still not working with:
|
We can just do like this: https://github.com/vuejs/test-utils/pull/1441/files. Using If there's a case not covered by the example in the PR, we can re-open or make a new issue. For now I don't see any obvious actionable here, so I'll close this as inactive. |
Consider the following component:
And the following test:
We would expect the test to pass (it did on Vue 2/VTU 1) but I've noticed two problems.
The event for the keyboard event never fires.
I believe this may be an underlying problem of how the keyup modifier is working on Vue 3 possibly. Im testing this with the 3.1 compact build.
The click event fires, BUT for both tests there's an additional emit that is happening.
The second test actually fails because the
emitted()
is adding a second event.The first element in the array is the actual
click
emit that the input should fire, the second one is being injected by either vtu or vue.On the first test, with the keyboard event we have a similar problem.
There is an emitted
keyup
event by the component, where there should not be since there is nokeyup
$emit
anywhere.Hope this was clear!
package.json for reference:
The text was updated successfully, but these errors were encountered: