[Vuejs]-Vue test component: Can't select element from a snackbar

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...)
      })
    })
  })

Leave a comment