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
Hello. First off, thank you for all the work you all have done. I have had a really great experience testing w/ vue-test-utils over the last year.
I am having trouble understanding how we're supposed to mount components using the Composition API if we no longer have access to setData({})? I've read from posts and videos that you simply can't. I've read from contributors that you should not need to alter any data in setup(), rather it should come from props? This doesn't make sense to me, as I have template code that relies off data in setup(). Perhaps there are some obvious things I am missing. Am I almost there, and simply need to retype out computed properties and return everything? It feels like a lot more setup to test compared to Options, so I have the feeling I am doing this incorrectly.
Below I have pasted a component and test file as well as the following warnings:
[Vue warn]: Property "mobile" was accessed during render but is not defined on instance at <Collections ref="VTU_COMPONENT" >
...
[Vue warn]: Property "mobile" was accessed during render but is not defined on instance at <Collections ref="VTU_COMPONENT" >
...
[Vue warn]: Property "collectionName" was accessed during render but is not defined on instance at <Content key=0 class="trail" >
...
[Vue warn]: Property "fullCollectionName" was accessed during render but is not defined on instance at <RouterLink to="/collections/undefined/offers" >
...
[Vue warn]: Property "heroProps" was accessed during render but is not defined on instance. ...
[Vue warn]: Missing required prop: "img" at <Hero>
...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello. First off, thank you for all the work you all have done. I have had a really great experience testing w/
vue-test-utils
over the last year.I am having trouble understanding how we're supposed to mount components using the Composition API if we no longer have access to
setData({})
? I've read from posts and videos that you simply can't. I've read from contributors that you should not need to alter any data insetup()
, rather it should come from props? This doesn't make sense to me, as I have template code that relies off data insetup()
. Perhaps there are some obvious things I am missing. Am I almost there, and simply need to retype out computed properties and return everything? It feels like a lot more setup to test compared to Options, so I have the feeling I am doing this incorrectly.Below I have pasted a component and test file as well as the following warnings:
Component.test.js
Component.vue
Beta Was this translation helpful? Give feedback.
All reactions