diff --git a/components/date-picker/__tests__/__snapshots__/DatePicker.test.js.snap b/components/date-picker/__tests__/__snapshots__/DatePicker.test.js.snap index 8a5efecd5d..732c666931 100644 --- a/components/date-picker/__tests__/__snapshots__/DatePicker.test.js.snap +++ b/components/date-picker/__tests__/__snapshots__/DatePicker.test.js.snap @@ -115,6 +115,7 @@ exports[`DatePicker prop locale should works 1`] = `
{ , ); - const calendarWrapper = mount( - wrapper - .find('Trigger') - .instance() - .getComponent(), - ); + function findNode(selector) { + return wrapper.find('Trigger').find(selector); + } + expect( - calendarWrapper - .find('.ant-calendar-time-picker-btn') - .hasClass('ant-calendar-time-picker-btn-disabled'), + findNode('.ant-calendar-time-picker-btn').hasClass('ant-calendar-time-picker-btn-disabled'), ).toBe(true); - expect( - calendarWrapper.find('.ant-calendar-ok-btn').hasClass('ant-calendar-ok-btn-disabled'), - ).toBe(true); - calendarWrapper - .find('.ant-calendar-date') + expect(findNode('.ant-calendar-ok-btn').hasClass('ant-calendar-ok-btn-disabled')).toBe(true); + findNode('.ant-calendar-date') .at(10) .simulate('click'); - calendarWrapper - .find('.ant-calendar-date') + findNode('.ant-calendar-date') .at(11) .simulate('click'); + expect( - calendarWrapper - .find('.ant-calendar-time-picker-btn') - .hasClass('ant-calendar-time-picker-btn-disabled'), - ).toBe(false); - expect( - calendarWrapper.find('.ant-calendar-ok-btn').hasClass('ant-calendar-ok-btn-disabled'), + findNode('.ant-calendar-time-picker-btn').hasClass('ant-calendar-time-picker-btn-disabled'), ).toBe(false); + expect(findNode('.ant-calendar-ok-btn').hasClass('ant-calendar-ok-btn-disabled')).toBe(false); expect(onChangeFn).toHaveBeenCalled(); expect(onOpenChangeFn).not.toHaveBeenCalled(); }); - it('hould trigger onOk when press ok button', () => { + it('should trigger onOk when press ok button', () => { const onOkFn = jest.fn(); const onChangeFn = jest.fn(); const onOpenChangeFn = jest.fn(); @@ -147,22 +136,18 @@ describe('RangePicker with showTime', () => { />, ); - const calendarWrapper = mount( - wrapper - .find('Trigger') - .instance() - .getComponent(), - ); - calendarWrapper - .find('.ant-calendar-date') + function findNode(selector) { + return wrapper.find('Trigger').find(selector); + } + + findNode('.ant-calendar-date') .at(10) .simulate('click'); - calendarWrapper - .find('.ant-calendar-date') + findNode('.ant-calendar-date') .at(11) .simulate('click'); onChangeFn.mockClear(); - calendarWrapper.find('.ant-calendar-ok-btn').simulate('click'); + findNode('.ant-calendar-ok-btn').simulate('click'); expect(onOkFn).toHaveBeenCalled(); expect(onOpenChangeFn).toHaveBeenCalledWith(false); expect(onChangeFn).not.toHaveBeenCalled(); diff --git a/components/date-picker/style/Calendar.less b/components/date-picker/style/Calendar.less index 79d3052100..c80b11d0e2 100644 --- a/components/date-picker/style/Calendar.less +++ b/components/date-picker/style/Calendar.less @@ -186,6 +186,7 @@ &-panel { position: relative; + outline: none; } &:hover { diff --git a/components/locale-provider/__tests__/__snapshots__/index.test.js.snap b/components/locale-provider/__tests__/__snapshots__/index.test.js.snap index 75eba7dfe2..8d11412240 100644 --- a/components/locale-provider/__tests__/__snapshots__/index.test.js.snap +++ b/components/locale-provider/__tests__/__snapshots__/index.test.js.snap @@ -84,6 +84,7 @@ exports[`Locale Provider set moment locale when locale changes 1`] = `