[Vuejs]-Unit Testing VueJS Karma Mocha ExpectJS nextTick not working

0👍

I found that the solution is to pass the password data into the component constructor since it is bound like this <input v-model="password"> to the input tag.

let thePassword = '123'

// Extend the component to get the constructor, which we can then initialize directly.
const Constructor = Vue.extend(Signup)
const component = new Constructor({
  propsData: {
    emailentry: email
  },
  data: {
    password: thePassword        
  }
}).$mount()

Now the tests are working.

Leave a comment