I have a simple login form with a username and password and submit button. When a user clicks submit button a function "login" is being called. This function describes the next behavior:
In my unit test, I want to test function "showTest" to check whether errors notifications are called.
Foreword: I have another case where I checked it and everything works properly.
My problem is that Jest says that the showToast function was not called, although in fact it is being called. And this can be seen in the logs.
So I put console.log in different places and due to them everything works in code but jest says that function showToast() wasn't called.
By the way, I mocked function in Vuex store which imitates request.
So how to fix this stupid and weird bug?
All code screenshots are attached.