Replies: 4 comments 4 replies
-
Hi @Vasim3 I don't think If that does not work, can you share a minimal repro so we can take a look? |
Beta Was this translation helpful? Give feedback.
-
Hi @cexbrayat
action.js
action.html
But still, it is throwing an error as follows:
|
Beta Was this translation helpful? Give feedback.
-
It's complaining because it cannot find the ref and not an issue of the function mock |
Beta Was this translation helpful? Give feedback.
-
This is still an issue, as far as I can tell. component.vue
component.test.ts
https://stackblitz.com/edit/vitest-dev-vitest-dlc9kh?file=test%2Fdialog.test.ts I have omitted |
Beta Was this translation helpful? Give feedback.
-
I have used the below code in the respective file.
action.html
<modal ref="deleteModal" ></modal>
action.js
this.$refs.deleteModal.closeModal()
action.spec.js
wrapper.vm.$refs['deleteModal'].openModal = jest.fn()
It is working in vue 2 but in migration with vue 3 and throwing below error
TypeError: Cannot set property 'openModal' of undefined
Beta Was this translation helpful? Give feedback.
All reactions