0π
β
It has just not done async login my guess is here. Test if login has been called and test the login
method in its own unit β currently its a weird approach to test the login
method.
E.g.:
describe("clicked submit", function clickedSubmit(){
it("should call vm.login", function(){
...
expect(vm.login).toBeCalledTimes(1)
expect(vm.login).toBeCalledWith("args")
})
})
describe("vm.login", function(){
describe("called with invalid userdata & invalid pass", function(){
it("should invalidate", async function(){
await vm.login(...args)
await vm.$nextTick()
...
expect(vm.message).toBe("target value")
//expect(vm.$el...)
})
})
})
Source:stackexchange.com