ant-design-vue/components/time-picker/__tests__/index.test.js
2018-12-09 17:34:27 +08:00

24 lines
653 B
JavaScript

import { mount } from '@vue/test-utils'
import VcTimePicker from '../../vc-time-picker/TimePicker'
import TimePicker from '..'
import focusTest from '../../../tests/shared/focusTest'
describe('TimePicker', () => {
focusTest(TimePicker)
it('renders addon correctly', () => {
const wrapper = mount({
render () {
return <TimePicker addon={() => (<button type='button'>Ok</button>)} />
},
})
const vcTimePicker = wrapper.find({ name: VcTimePicker.name })
const addonWrapper = mount({
render () {
return vcTimePicker.vm.addon()
},
})
expect(addonWrapper.html()).toMatchSnapshot()
})
})