vee-validate
vee-validate copied to clipboard
Custom input vee-validate test jest
vue 3 with vee-validate 4 trying to test with jest if I use stubs test work
const wrapper = mount(EmailView, {
global: {
plugins: [router],
components: { NavBar, Form, TextInput },
stubs: {
TextInput: true,
},
},
});
await flushPromises();
but I can't test my custom inputs "text-input-stub"
<form novalidate="" id="formEmail" data-test="formEmail">
<text-input-stub name="email" label="Correo electrónico" poppericon="icon-i.svg" mask="" cursor="" type="text" successmessage="" placeholder="Correo electrónico" reset="false" preventpaste="false" data-test="inputEmail"></text-input-stub>
<text-input-stub name="emailConfirme" label="Confirma tu correo" poppericon="icon-i.svg" mask="" cursor="" type="text" successmessage="" placeholder="Confirma tu correo" reset="false" preventpaste="true" data-test="inputEmailConfirme"></text-input-stub>
</form>
if i remove stub
const wrapper = mount(EmailView, {
global: {
plugins: [router],
components: { NavBar, Form, TextInput },
},
});
await flushPromises();
test error
node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:2752 if (dir.deep) {
TypeError: Cannot read properties of undefined (reading 'deep')