test(input): update test (#1483)

This commit is contained in:
XieZongChen 2021-10-30 01:12:38 -05:00 committed by GitHub
parent 636e6dcfbf
commit f1fd51e0ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -83,6 +83,15 @@ describe('n-input', () => {
wrapper.unmount()
})
it('should work with `rows` prop', async () => {
const wrapper = mount(NInput, { props: { type: 'textarea' } })
expect(wrapper.find('textarea').attributes('rows')).toBe('3')
await wrapper.setProps({ type: 'textarea', rows: 5 })
expect(wrapper.find('textarea').attributes('rows')).toBe('5')
wrapper.unmount()
})
it('should work with `size` prop', async () => {
;(['small', 'medium', 'large'] as const).forEach((size) => {
const wrapper = mount(NInput, { props: { size: size } })