diff --git a/tests/range.spec.tsx b/tests/range.spec.tsx index 87cef745b..791a7e501 100644 --- a/tests/range.spec.tsx +++ b/tests/range.spec.tsx @@ -49,6 +49,7 @@ describe('Picker.Range', () => { resetWarned(); global.scrollCalled = false; jest.useFakeTimers().setSystemTime(getDay('1990-09-03 00:00:00').valueOf()); + document.body.innerHTML = ''; }); afterEach(() => { @@ -2054,4 +2055,20 @@ describe('Picker.Range', () => { 'rc-picker-input-active', ); }); + + it('should not click to focus on next field if first field is not confirm', () => { + const onCalendarChange = jest.fn(); + const { container } = render( + , + ); + + // Select first field + openPicker(container, 0); + selectCell(11); + expect(onCalendarChange).toHaveBeenCalled(); + + // Not click confirm and click next field + openPicker(container, 1); + expect(container.querySelectorAll('.rc-picker-input')[0]).toHaveClass('rc-picker-input-active'); + }); });