test(dynamic-input): Add test (#1242)

* test(dynamic-input): Add dynamic-input component test

* docs(dynamic-input): Update dynamic-input component test
This commit is contained in:
songjianet 2021-09-26 22:36:34 +08:00 committed by GitHub
parent f8b196f207
commit f4be21244e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,4 +5,16 @@ describe('n-dynamic-input', () => {
it('should work with import on demand', () => {
mount(NDynamicInput)
})
it('should work with `value`', async () => {
const wrapper = mount(NDynamicInput, {
props: {
value: ['aaa']
}
})
const inputEl = await wrapper.find('input')
expect(inputEl.element.value).toEqual('aaa')
expect(wrapper.html()).toContain('data-key="0"')
})
})