diff --git a/packages/components/time-picker/__tests__/time-picker.spec.ts b/packages/components/time-picker/__tests__/time-picker.spec.ts index a0ee43aa87..af1c989e5a 100644 --- a/packages/components/time-picker/__tests__/time-picker.spec.ts +++ b/packages/components/time-picker/__tests__/time-picker.spec.ts @@ -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( ``, - () => ({ 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()