File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ describe('Picker.Range', () => {
4949 resetWarned ( ) ;
5050 global . scrollCalled = false ;
5151 jest . useFakeTimers ( ) . setSystemTime ( getDay ( '1990-09-03 00:00:00' ) . valueOf ( ) ) ;
52+ document . body . innerHTML = '' ;
5253 } ) ;
5354
5455 afterEach ( ( ) => {
@@ -2054,4 +2055,20 @@ describe('Picker.Range', () => {
20542055 'rc-picker-input-active' ,
20552056 ) ;
20562057 } ) ;
2058+
2059+ it ( 'should not click to focus on next field if first field is not confirm' , ( ) => {
2060+ const onCalendarChange = jest . fn ( ) ;
2061+ const { container } = render (
2062+ < DayRangePicker onCalendarChange = { onCalendarChange } showTime needConfirm /> ,
2063+ ) ;
2064+
2065+ // Select first field
2066+ openPicker ( container , 0 ) ;
2067+ selectCell ( 11 ) ;
2068+ expect ( onCalendarChange ) . toHaveBeenCalled ( ) ;
2069+
2070+ // Not click confirm and click next field
2071+ openPicker ( container , 1 ) ;
2072+ expect ( container . querySelectorAll ( '.rc-picker-input' ) [ 0 ] ) . toHaveClass ( 'rc-picker-input-active' ) ;
2073+ } ) ;
20572074} ) ;
You can’t perform that action at this time.
0 commit comments