I have a component where I implement the ion-toggle component.
The component emits @ionChange and when triggered it calls my function like so:
<ion-item>
<ion-label>test</ion-label>
<ion-toggle
@ionChange="myFunction"
:checked="item.selected">
</ion-toggle>
</ion-item>
It works great but I can’t find out how to unit test this. Not matter what I do it won’t trigger the emit ionChange and call my function.
If I change @ionChange to @click it works when I do.
Wrapper.find(‘ion-toggle’).trigger(‘click’)
But I can’t seem to make I work whit ionic custom events.
How do you guys do it?
I’m using jest the with vue3 composition api and typescript