You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After using setProps in a component mounted with mountSuspended, using $emit inside a method will emit the event twice, which can be checked with wrapper.emitted(). This behaviour does not exist when using mount(). Please see reproduction link.
A workaround is to use the $emit directly in the @click attribute, like this:
<button @click="$emit('test', 'a')">test</button>
But this is not sufficient if a method needs to be called that does other things as well besides emitting.
Additional context
No response
Logs
The text was updated successfully, but these errors were encountered:
Environment
Reproduction
https://stackblitz.com/edit/github-4czkz34t?file=components%2FMyComponent.vue,test%2FMyComponent.test.js
Describe the bug
After using
setProps
in a component mounted withmountSuspended
, using$emit
inside a method will emit the event twice, which can be checked withwrapper.emitted()
. This behaviour does not exist when usingmount()
. Please see reproduction link.A workaround is to use the
$emit
directly in the@click
attribute, like this:But this is not sufficient if a method needs to be called that does other things as well besides emitting.
Additional context
No response
Logs
The text was updated successfully, but these errors were encountered: