late-waiter-93776
05/18/2022, 3:42 AMconst state = reactive({...});
how can I access state from within my test?wonderful-match-15836
05/19/2022, 1:46 PMwrapper.vm
for this, see the Vue Test Utils docs: https://test-utils.vuejs.org/api/#vm
For props you can use wrapper.props
as opposed to `propsData`: https://test-utils.vuejs.org/api/#props-1
I'm assuming Vue 3, there are different set of those docs for Vue 2 so ymmv.
In general though, I would consider these a last resort, and would recommend a test that verifies these values from the UI side or from the events the component should emit when they change, which can avoid your test depending on the names and behavior of the internals of a component.
But if you do need to be in there, following the VTU docs should work.late-waiter-93776
05/19/2022, 6:36 PM