0👍
The problem is with the .trigger. As docs says it fires event on the DOM node. If you explicitly specifying the event in emits
block it says that your component will fire it. Otherwise VTU just trigger the load-data
event as DOM node event.
In your case you shoud use $emit
wrapper.findComponent('[data-test="dropdown-test"]').vm.$emit('load-data')
await wrapper.vm.$nextTick() // Wait until $emits have been handled
// then
expect(wrapper.emitted('first-event'))...
expect(wrapper.emitted('second-event'))...
- [Vuejs]-Vue + firebase auth output console.log of auth/internal-error instead auth/invalid-password
- [Vuejs]-How to pass Dynamic Props through Routes in Vue 3?
Source:stackexchange.com