After a lot of research I was finally able to test an method with the follow code
it('should call myFunction - on Desktop', async () => {
const mockMethod = jest.spyOn(myComponent.methods, 'myFunction')
const wrapper = shallowMount(
myComponent,
{
store,
localVue,
propsData,
stubs,
},
)
await wrapper.findAll('.container button-stub').at(0).trigger('click')
expect(mockMethod).toHaveBeenCalled()
})
And it worked :pray-pep: But know I need to test an method passing an parameter and comparing the result. This method changes my data, my data is like follows
data () {
return {
myOptions: [],
}
},
This method adds the argument, that is an number, in myOptions. That is what an want to test, call the function and compare if the parameter passed was added to myOptions
Sorry for my english and talks for the help