[Vuejs]-(VUEX + JEST) Function response is undefined

1👍

Now I see it:

Look, you are mockinhandleLogin as a store action. But it is NOT your store action. It is your method in a component.

So what you need to do is:

... // your previous code

wrapper.setMethods({ handleLogin: jest.fn() })  // add this line here
wrapper.find('.main-form__login-submit').trigger('click')

... // your next code

Leave a comment