mirror of
https://github.com/element-plus/element-plus.git
synced 2025-01-18 10:59:10 +08:00
test(components): fix time picker default value in cancel test (#4938)
This commit is contained in:
parent
931bc691e0
commit
1682b18684
@ -463,22 +463,29 @@ describe('TimePicker(range)', () => {
|
||||
})
|
||||
|
||||
it('cancel button', async () => {
|
||||
const cancelDates = [
|
||||
new Date(2016, 9, 10, 9, 40),
|
||||
new Date(2016, 9, 10, 15, 40),
|
||||
]
|
||||
const wrapper = _mount(
|
||||
`<el-time-picker
|
||||
v-model="value"
|
||||
is-range
|
||||
/>`,
|
||||
() => ({ value: '' })
|
||||
() => ({
|
||||
value: cancelDates,
|
||||
})
|
||||
)
|
||||
|
||||
const input = wrapper.find('input')
|
||||
input.trigger('blur')
|
||||
await nextTick()
|
||||
input.trigger('focus')
|
||||
await nextTick()
|
||||
;(document.querySelector('.el-time-panel__btn.cancel') as any).click()
|
||||
await nextTick()
|
||||
const vm = wrapper.vm as any
|
||||
expect(vm.value).toBe('')
|
||||
expect(vm.value).toEqual(cancelDates)
|
||||
input.trigger('blur')
|
||||
input.trigger('focus')
|
||||
await nextTick()
|
||||
|
Loading…
Reference in New Issue
Block a user