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

test: Rewritten grouping test without checking internal class FormSubmission

This commit is contained in:
Zaytsev Kirill 2020-10-21 15:58:25 +03:00
parent 1bc952c9c0
commit 6e0f9b3223

View File

@ -21,11 +21,19 @@ describe('FormularioGrouping', () => {
`
}
})
expect(wrapper.findAll('input[type="text"]').length).toBe(1)
wrapper.find('input[type="text"]').setValue('test')
const submission = await wrapper.vm.formSubmitted()
expect(submission).toEqual({ group: { text: 'test' } })
expect(wrapper.findAll('input[type="text"]').length).toBe(1)
wrapper.find('input[type="text"]').setValue('test')
wrapper.find('form').trigger('submit')
await flushPromises()
const emitted = wrapper.emitted()
expect(emitted['submit']).toBeTruthy()
expect(emitted['submit'].length).toBe(1)
expect(emitted['submit'][0]).toStrictEqual([{ group: { text: 'test' } }])
})
it('Grouped fields to be got', async () => {