@@ -231,7 +231,7 @@ describe('Picker.Range', () => {
231
231
expect ( baseElement . querySelector ( '.rc-picker-dropdown-hidden' ) ) . toBeTruthy ( ) ;
232
232
} ) ;
233
233
234
- it ( 'should not be checked if the value is disabled' , ( ) => {
234
+ it ( 'should not be checked if the startDate is disabled' , ( ) => {
235
235
const onChange = jest . fn ( ) ;
236
236
const { container } = render (
237
237
< DayRangePicker
@@ -249,6 +249,24 @@ describe('Picker.Range', () => {
249
249
[ '2024-10-28' , '2024-11-21' ] ,
250
250
) ;
251
251
} ) ;
252
+ it ( 'should not be checked if the endDate is disabled' , ( ) => {
253
+ const onChange = jest . fn ( ) ;
254
+ const { container } = render (
255
+ < DayRangePicker
256
+ disabled = { [ false , true ] }
257
+ defaultValue = { [ getDay ( '2024-10-28' ) , getDay ( '2024-11-20' ) ] }
258
+ disabledDate = { ( date : Dayjs ) => date >= dayjs ( '2024-11-10' ) . endOf ( 'day' ) }
259
+ onChange = { onChange }
260
+ /> ,
261
+ ) ;
262
+
263
+ openPicker ( container , 0 ) ;
264
+ selectCell ( '21' , 0 ) ;
265
+ expect ( onChange ) . toHaveBeenCalledWith (
266
+ [ expect . anything ( ) , expect . anything ( ) ] ,
267
+ [ '2024-10-21' , '2024-11-20' ] ,
268
+ ) ;
269
+ } ) ;
252
270
253
271
it ( 'should close panel when finish first choose with showTime = true and disabled = [false, true]' , ( ) => {
254
272
const { baseElement } = render ( < DayRangePicker showTime disabled = { [ false , true ] } /> ) ;
0 commit comments