File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,7 @@ export default class Day extends React.Component {
205205 onMouseEnter = { this . handleMouseEnter }
206206 aria-label = { `day-${ getDate ( this . props . day ) } ` }
207207 role = "option"
208+ aria-disabled = { this . isDisabled ( ) }
208209 >
209210 { this . props . renderDayContents
210211 ? this . props . renderDayContents (
Original file line number Diff line number Diff line change @@ -494,6 +494,17 @@ describe("Day", () => {
494494 const shallowDay = renderDay ( day , { excludeDates : [ day ] } ) ;
495495 expect ( shallowDay . hasClass ( className ) ) . to . equal ( true ) ;
496496 } ) ;
497+
498+ it ( "should have aria-disabled attribute with true value if date is disabled" , ( ) => {
499+ const day = newDate ( ) ;
500+ const shallowDay = renderDay ( day , { excludeDates : [ day ] } ) ;
501+ expect ( shallowDay . prop ( "aria-disabled" ) ) . to . equal ( true ) ;
502+ } ) ;
503+
504+ it ( "should have aria-disabled attribute with false value if date is not disabled" , ( ) => {
505+ const shallowDay = renderDay ( newDate ( ) ) ;
506+ expect ( shallowDay . prop ( "aria-disabled" ) ) . to . equal ( false ) ;
507+ } ) ;
497508 } ) ;
498509
499510 describe ( "click" , ( ) => {
You can’t perform that action at this time.
0 commit comments