test(input): update test (#1478)

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

View File

@ -120,6 +120,19 @@ describe('n-input', () => {
wrapper.unmount()
})
it('should work with `pair` `separator` `placeholder` prop', async () => {
const wrapper = mount(NInput, {
props: { pair: true, separator: '-', placeholder: ['从', '到'] }
})
expect(wrapper.find('.n-input').classes()).toContain('n-input--pair')
expect(wrapper.find('.n-input__separator').text()).toBe('-')
expect(wrapper.findAll('input')[0].attributes('placeholder')).toBe('从')
expect(wrapper.findAll('input')[1].attributes('placeholder')).toBe('到')
wrapper.unmount()
})
it('should work with `on-blur` prop', async () => {
const onBlur = jest.fn()
const wrapper = mount(NInput, {