2018-06-17 15:57:09 +08:00
|
|
|
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 () {
|
2018-09-05 21:28:54 +08:00
|
|
|
return <TimePicker addon={() => (<button type='button'>Ok</button>)} />
|
2018-06-17 15:57:09 +08:00
|
|
|
},
|
|
|
|
})
|
|
|
|
const vcTimePicker = wrapper.find({ name: VcTimePicker.name })
|
|
|
|
const addonWrapper = mount({
|
|
|
|
render () {
|
2018-12-09 17:34:27 +08:00
|
|
|
return vcTimePicker.vm.addon()
|
2018-06-17 15:57:09 +08:00
|
|
|
},
|
|
|
|
})
|
|
|
|
expect(addonWrapper.html()).toMatchSnapshot()
|
|
|
|
})
|
|
|
|
})
|