From 61337aecef0c869692ea9bee7285549ba77bbe16 Mon Sep 17 00:00:00 2001 From: tanjinzhou <415800467@qq.com> Date: Tue, 4 Aug 2020 17:50:19 +0800 Subject: [PATCH] test: update time-picker test --- antdv-demo | 2 +- .../__snapshots__/index.test.js.snap | 5 +++- .../time-picker/__tests__/index.test.js | 27 ++++++++++--------- components/vc-trigger/Trigger.jsx | 4 +++ examples/App.vue | 2 +- tests/shared/mountTest.js | 13 ++++++++- 6 files changed, 36 insertions(+), 17 deletions(-) diff --git a/antdv-demo b/antdv-demo index 7c35d4f5f..a5c0b0c35 160000 --- a/antdv-demo +++ b/antdv-demo @@ -1 +1 @@ -Subproject commit 7c35d4f5f4ab0ea204cf944ef70e8705f41c7c3f +Subproject commit a5c0b0c35c3b6d8284caa99b11229b709d035e6d diff --git a/components/time-picker/__tests__/__snapshots__/index.test.js.snap b/components/time-picker/__tests__/__snapshots__/index.test.js.snap index 5566362a7..fabce4694 100644 --- a/components/time-picker/__tests__/__snapshots__/index.test.js.snap +++ b/components/time-picker/__tests__/__snapshots__/index.test.js.snap @@ -1,5 +1,8 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`TimePicker not render clean icon when allowClear is false 1`] = ``; +exports[`TimePicker not render clean icon when allowClear is false 1`] = ` + +`; exports[`TimePicker renders addon correctly 1`] = ` +
`; diff --git a/components/time-picker/__tests__/index.test.js b/components/time-picker/__tests__/index.test.js index 7f5aa0bed..e4fca9ad7 100644 --- a/components/time-picker/__tests__/index.test.js +++ b/components/time-picker/__tests__/index.test.js @@ -4,10 +4,13 @@ import TimePicker from '..'; import moment from 'moment'; import focusTest from '../../../tests/shared/focusTest'; import mountTest from '../../../tests/shared/mountTest'; +import { sleep } from '../../../tests/utils'; describe('TimePicker', () => { const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); - + beforeEach(() => { + document.body.innerHTML = ''; + }); afterEach(() => { errorSpy.mockReset(); }); @@ -19,19 +22,17 @@ describe('TimePicker', () => { focusTest(TimePicker); mountTest(TimePicker); - it('renders addon correctly', () => { - const wrapper = mount({ - render() { - return