[Vuejs]-Testing Vuetify with Vue-test-utils โ€“ Cannot set value to v-text-field

1๐Ÿ‘

โœ…

I tried to repeat your example and it works

Component:

<template>
  <v-text-field
    v-model="form.email"
    test-id="input-email"
  />
</template>

<script>
export default {
  data () {
    return {
      form: { email: '' },
    }
  },
}
</script>

Test:

import Input from './input.vue'
import { mount } from '@vue/test-utils'

describe('input', () => {
  it('should set v-model', () => {
    const wrapper = mount(Input)
    const input = wrapper.findComponent('[test-id="input-email"]')
    input.setValue('test')
  })
})
๐Ÿ‘คIgor Gerasimov

Leave a comment