test(input): update test (#1494)

This commit is contained in:
XieZongChen 2021-11-01 01:49:12 -05:00 committed by GitHub
parent 5c09bd3029
commit 98a8c1b01d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -199,10 +199,19 @@ describe('n-input', () => {
it('should work with `prefix` slots', async () => {
const wrapper = mount(NInput, {
slots: { prefix: '#' }
slots: { prefix: '' }
})
expect(wrapper.find('.n-input__prefix').exists()).toBe(true)
expect(wrapper.find('.n-input__prefix').text()).toBe('#')
expect(wrapper.find('.n-input__prefix').text()).toBe('¥')
wrapper.unmount()
})
it('should work with `suffix` slots', async () => {
const wrapper = mount(NInput, {
slots: { suffix: '元' }
})
expect(wrapper.find('.n-input__suffix').exists()).toBe(true)
expect(wrapper.find('.n-input__suffix').text()).toBe('元')
wrapper.unmount()
})
})