ant-design-vue/components/transfer/__tests__/search.test.js

20 lines
414 B
JavaScript
Raw Normal View History

2018-05-23 08:07:02 +00:00
import { mount } from '@vue/test-utils'
import Search from '../search'
describe('Search', () => {
it('should show cross icon when input value exists', () => {
2018-05-23 08:48:45 +00:00
const props = {
propsData: {
value: '',
},
}
const wrapper = mount(Search, props)
2018-05-23 08:07:02 +00:00
2018-05-23 08:48:45 +00:00
expect(wrapper.html()).toMatchSnapshot()
2018-05-23 08:07:02 +00:00
wrapper.setProps({ value: 'a' })
2018-05-23 08:48:45 +00:00
expect(wrapper.html()).toMatchSnapshot()
2018-05-23 08:07:02 +00:00
})
})