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 } />; + it('renders addon correctly', async () => { + mount( + { + render() { + return } />; + }, }, - }); - const vcTimePicker = wrapper.find({ name: VcTimePicker.name }); - const addonWrapper = mount({ - render() { - return vcTimePicker.vm.addon(); - }, - }); - expect(addonWrapper.html()).toMatchSnapshot(); + { sync: false, attachTo: 'body' }, + ); + await sleep(); + expect(document.body.querySelector('.ant-time-picker-panel-addon').outerHTML).toMatchSnapshot(); }); it('allowEmpty deprecated', () => { diff --git a/components/vc-trigger/Trigger.jsx b/components/vc-trigger/Trigger.jsx index 61e25fa4f..5ff0739ae 100644 --- a/components/vc-trigger/Trigger.jsx +++ b/components/vc-trigger/Trigger.jsx @@ -91,6 +91,10 @@ export default { }); this._component = null; this.focusTime = null; + this.clickOutsideHandler = null; + this.contextmenuOutsideHandler1 = null; + this.contextmenuOutsideHandler2 = null; + this.touchOutsideHandler = null; return { prevPopupVisible: popupVisible, sPopupVisible: popupVisible, diff --git a/examples/App.vue b/examples/App.vue index 992320fb5..08e3c6909 100644 --- a/examples/App.vue +++ b/examples/App.vue @@ -4,7 +4,7 @@