After setting a value for the checkbox, I encountered a warning message: [Vue warn]: Component emitted event "update:modelValue" but it is neither declared in the emits option nor as an "onUpdate:modelValue" prop.
Example.vue
<script setup lang="ts">
import { VForm } from 'vuetify/components'
const privacyPolicies = ref<boolean>(false)
</script>
<template id="register-form">
<VCardText>
<VForm
id="registerForm"
class="mt-4"
>
<VRow>
<VCol cols="12">
<VCheckbox
v-model="privacyPolicies"
data-privacy-policy
/>
</VCol>
</VRow>
</VForm>
</VCardText>
</template>
Example.test.ts
import TestRegister from '@/pages/components/example.vue'
...
describe.concurrent('Example.vue', () => {
let wrapper: VueWrapper
beforeEach(() => {
wrapper = mount(TestRegister, {
global: {
plugins: [
createVuetify({ components, directives }),
],
},
})
})
it('performing a test', async () => {
const checkBoxSelector = '[data-privacy-policy]'
await wrapper.findComponent<typeof VCheckbox>(checkBoxSelector).setValue(true)
})
})