-
Notifications
You must be signed in to change notification settings - Fork 258
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
findComponent doesn't work as expected after upgrade to 2.0.0-beta.5 for use with Vue 3 #211
Comments
I transferred this to vue-test-utils-next. Can you please post your entire component and test (and ideally a repository of some sort). It is difficult to fix abug without a reproduction. Based on your above info, are you trying to find a component in itself? Or does |
Sure thing, I'll wrap up a test repo. No, For example, the following used to work just fine:
where Is this no longer supported? If not, how do one get access to the root-component when using |
The reason I’m asking is that saw just now that |
If it's the root component, can't you just do |
Hmm, I see - can I open an issue or make a PR to add it the docs then? It's removed from the wrapper section in the reference. I've put together a repo with a test case that passes with a set of previous versions of dependencies (basically [email protected] with test-utils and jest), but when updating to Vue@3 and [email protected] fails. The repo can be found here: |
Sure! docs repo is here: https://github.com/vuejs/vue-test-utils-next please add I will investigate fixing this bug. |
Kind of fixed... #214 You will need to a |
To be perfectly honest, I'm not sure. I can't recall why we wrote these tests the way they are written, and can't definitely say that they weren't refactored into the current state. That being said, backwards-compatibility wise there's a difference here. Thanks for the fix though! |
There sure is a difference. I think if we can either make it 100% back-compat, that's ideal. If not, I think that's fine too, as long as we provide a migration guide (in this case, add a Posting this issue helped find the bug - which is great. I'll merge what we have for now, do a release, and keep thinking about how to get this to work in a 100% back compat way (if that's possible). |
Subject of the issue
Previously passing tests now fail.
Steps to reproduce
The following test setup:
results in an error
Cannot call find on an empty VueWrapper.
even though the component was just mounted. This occurs even with the followingConversation.vue
:This feature works as expected post-migration to vue3, but the tests fail on this.
Expected behaviour
That findComponent should find the mounted component.
Actual behaviour
findComponent returns an empty VueWrapper.
Possible Solution
I've tried simplifying the components, but the problem still persists.
The text was updated successfully, but these errors were encountered: