1
0
mirror of synced 2024-11-22 05:16:05 +03:00

test: Improved checking validation event & code style

This commit is contained in:
Zaytsev Kirill 2021-05-22 15:29:01 +03:00
parent cb2f350edf
commit 4cec18b1d7
2 changed files with 4 additions and 5 deletions

View File

@ -320,7 +320,7 @@ describe('FormularioForm', () => {
expect(wrapper.vm.mergedFieldErrors.inputB.length).toBe(2)
})
it('Emits correct validation event when no errors', async () => {
it('emits correct validation event when no errors', async () => {
const wrapper = mount(FormularioForm, {
slots: {
default: `
@ -337,11 +337,10 @@ describe('FormularioForm', () => {
await flushPromises()
expect(wrapper.emitted('validation')).toBeTruthy()
expect(wrapper.emitted('validation').length).toBe(1)
expect(wrapper.emitted('validation')[0][0]).toEqual({
expect(wrapper.emitted('validation')).toEqual([[{
name: 'foo',
violations: [],
})
}]])
})
it('Emits correct validation event on entry', async () => {

View File

@ -6,7 +6,7 @@ import Formulario from '@/index.ts'
import FormularioForm from '@/FormularioForm.vue'
import FormularioInput from '@/FormularioInput.vue'
const globalRule = jest.fn(() => { return false })
const globalRule = jest.fn(() => false)
Vue.use(Formulario, {
validationRules: { globalRule },