import Vue from 'vue' import { mount, shallowMount } from '@vue/test-utils' import flushPromises from 'flush-promises' import Formulario from '../../src/Formulario.js' import FormSubmission from '../../src/FormSubmission.js' import FormularioForm from '@/FormularioForm.vue' import FormularioInput from '@/FormularioInput.vue' function validationMessages (instance) { instance.extend({ validationMessages: { required: () => 'required', 'in': () => 'in', min: () => 'min', } }) } Vue.use(Formulario, { plugins: [validationMessages] }) describe('FormularioForm', () => { it('render a form DOM element', () => { const wrapper = mount(FormularioForm) expect(wrapper.find('form').exists()).toBe(true) }) it('accepts a default slot', () => { const wrapper = mount(FormularioForm, { slots: { default: '
' } }) expect(wrapper.find('form div.default-slot-item').exists()).toBe(true) }) it('intercepts submit event', () => { const formSubmitted = jest.fn() const wrapper = mount(FormularioForm, { slots: { default: "