Can't use VueTestUtils wrapper.setProps when cy.mount is wrapping component #30965
Unanswered
hackel
asked this question in
Component Testing
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've been trying to debug an issue where calling wrapper.setProps has no effect. I believe I have narrowed it down to the wrapper I'm using in my
cy.mount
command. Here is a simplified example of what I mean:I figured this was setting the props on the wrapper instead of
Comp
, so I triedwrapper.getComponent(Comp).setProps({ value: 'bar' })
, but this gives the error: 'You can only use setProps on your mounted component'.At this point I'm stuck. What do I do? The reason I need to call setProps is that the component I'm testing relies on a custom v-model to test its internal behaviour. I was attempting to implement that like so:
Is there another way to accomplish this?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions