@@ -931,22 +931,37 @@ describe("DatePicker", () => {
931931 describe ( "with excludeDateIntervals" , ( ) => {
932932 it ( "should not select the start date of the interval" , ( ) => {
933933 var data = getOnInputKeyDownStuff ( {
934- excludeDateIntervals : [ { start : utils . subDays ( utils . newDate ( ) , 1 ) , end : utils . addDays ( utils . newDate ( ) , 1 ) } ]
934+ excludeDateIntervals : [
935+ {
936+ start : utils . subDays ( utils . newDate ( ) , 1 ) ,
937+ end : utils . addDays ( utils . newDate ( ) , 1 ) ,
938+ } ,
939+ ] ,
935940 } ) ;
936941 TestUtils . Simulate . keyDown ( data . nodeInput , getKey ( "ArrowLeft" ) ) ;
937942 TestUtils . Simulate . keyDown ( data . nodeInput , getKey ( "Enter" ) ) ;
938943 expect ( data . callback . calledOnce ) . to . be . false ;
939944 } ) ;
940945 it ( "should not select a dates within the interval" , ( ) => {
941946 var data = getOnInputKeyDownStuff ( {
942- excludeDateIntervals : [ { start : utils . subDays ( utils . newDate ( ) , 1 ) , end : utils . addDays ( utils . newDate ( ) , 1 ) } ]
947+ excludeDateIntervals : [
948+ {
949+ start : utils . subDays ( utils . newDate ( ) , 1 ) ,
950+ end : utils . addDays ( utils . newDate ( ) , 1 ) ,
951+ } ,
952+ ] ,
943953 } ) ;
944954 TestUtils . Simulate . keyDown ( data . nodeInput , getKey ( "Enter" ) ) ;
945955 expect ( data . callback . calledOnce ) . to . be . false ;
946956 } ) ;
947957 it ( "should not select the end date of the interval" , ( ) => {
948958 var data = getOnInputKeyDownStuff ( {
949- excludeDateIntervals : [ { start : utils . subDays ( utils . newDate ( ) , 1 ) , end : utils . addDays ( utils . newDate ( ) , 1 ) } ]
959+ excludeDateIntervals : [
960+ {
961+ start : utils . subDays ( utils . newDate ( ) , 1 ) ,
962+ end : utils . addDays ( utils . newDate ( ) , 1 ) ,
963+ } ,
964+ ] ,
950965 } ) ;
951966 TestUtils . Simulate . keyDown ( data . nodeInput , getKey ( "ArrowRight" ) ) ;
952967 TestUtils . Simulate . keyDown ( data . nodeInput , getKey ( "Enter" ) ) ;
@@ -1481,6 +1496,20 @@ describe("DatePicker", () => {
14811496 ) . to . equal ( weekAriaLabelPrefix ) ;
14821497 } ) ;
14831498
1499+ it ( "should pass monthAriaLabelPrefix prop to the correct child component" , ( ) => {
1500+ const monthAriaLabelPrefix = "My month-prefix" ;
1501+ const datePicker = mount (
1502+ < DatePicker
1503+ inline
1504+ showWeekNumbers
1505+ monthAriaLabelPrefix = { monthAriaLabelPrefix }
1506+ />
1507+ ) ;
1508+ expect ( datePicker . find ( Month ) . first ( ) . prop ( "ariaLabelPrefix" ) ) . to . equal (
1509+ monthAriaLabelPrefix
1510+ ) ;
1511+ } ) ;
1512+
14841513 it ( "should close the calendar after scrolling" , ( ) => {
14851514 var datePicker = TestUtils . renderIntoDocument ( < DatePicker closeOnScroll /> ) ;
14861515 var dateInput = datePicker . input ;
0 commit comments