taskagile / vuejs.spring-boot.mysql

Full-stack implementation of TaskAgile application with Vue.js, Spring Boot, and MySQL
75 stars 51 forks source link

npm unit test failed on vue form inputs bound #2

Open Lysander086 opened 4 years ago

Lysander086 commented 4 years ago

image err.log

Basically all unit tests failed at vue form data bound .

git commit log: 70d9be67de commit msg: implement e2e tests of login and register

GeoffreyHayward commented 4 years ago

Hi @Lysander686,

I had the same issue. Here is the fix that I came up with.

  it('should have form inputs bound with data model', () => {
    ...
    fieldUsername.setValue(username)
    fieldEmailAddress.setValue(emailAddress)
    fieldPassword.setValue(password)
    expect(wrapper.vm.form.username).toEqual(username)
    expect(wrapper.vm.form.emailAddress).toEqual(emailAddress)
    expect(wrapper.vm.form.password).toEqual(password)
  })

I hope that helps.