From 00b392e5ae2af33645476ca549b25513917fe47c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Tue, 12 Nov 2024 14:45:55 +0800 Subject: [PATCH] test: add test case --- tests/range.spec.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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'); + }); });