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
Bug: wrapper.findComponent no longer working after upgrading to 2.4.2 #2343
Comments
Have you tried with the latest version of Vue (v3.4.15) and VTU (v2.4.4) as well? If it doesn't work, can you provide us a small repro online using https://stackblitz.com/github/vuejs/create-vue-templates/tree/main/typescript-vitest?file=src%2Fcomponents%2F__tests__%2FHelloWorld.spec.ts ? It only takes a few minutes, and we'll be able to take a look |
Did you manage to build a repro or did you fix your issue and we can close this? |
Sorry haven't be able yet, perhaps this week! |
Hi are you using vitest? If so you may need to add
to your vitest config. |
Let me know if you have a repro or if we can close the issue (we can't look into it otherwise). I suspect that using both the later versions of VTU and Vue should be enough to solve it, but I'll wait for your answer before closing. |
Let's close the issue as we had no repro from the OP author. |
Describe the bug
Ever since we updated to v2.4.2, we've been experiencing an error with
wrapper.find
andwrapper.findComponent
.Error: Cannot call vm on an empty VueWrapper.
The find and findComponent methods no longer return a VueWrapper.
To Reproduce
Expected behavior
We are expecting the component to be returned so we can call methods on the component's vm.
wrapper.findComponent('[data-attribute-handle]').vm.$emit('close')
or
wrapper.findComponent('[data-attribute-handle]').vm.selected
Related information:
Vue test utils v2.4.2
Vue 3.2.37
Additional context
The text was updated successfully, but these errors were encountered: