File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
react-aria-components/test Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ export function useCalendarBase(props: CalendarPropsBase & DOMProps & AriaLabeli
93
93
return {
94
94
calendarProps : mergeProps ( domProps , labelProps , {
95
95
role : 'application' ,
96
+ 'aria-details' : props [ 'aria-details' ] || undefined ,
96
97
'aria-describedby' : props [ 'aria-describedby' ] || undefined
97
98
} ) ,
98
99
nextButtonProps : {
Original file line number Diff line number Diff line change @@ -83,6 +83,21 @@ describe('Calendar', () => {
83
83
}
84
84
} ) ;
85
85
86
+ it ( 'should support aria props on the Calendar' , ( ) => {
87
+ let { getByRole} = renderCalendar ( {
88
+ 'aria-label' : 'label' ,
89
+ 'aria-labelledby' : 'labelledby' ,
90
+ 'aria-describedby' : 'describedby' ,
91
+ 'aria-details' : 'details'
92
+ } ) ;
93
+
94
+ let group = getByRole ( 'application' ) ;
95
+ expect ( group ) . toHaveAttribute ( 'aria-label' , expect . stringContaining ( 'label' ) ) ;
96
+ expect ( group ) . toHaveAttribute ( 'aria-labelledby' , expect . stringContaining ( 'labelledby' ) ) ;
97
+ expect ( group ) . toHaveAttribute ( 'aria-describedby' , 'describedby' ) ;
98
+ expect ( group ) . toHaveAttribute ( 'aria-details' , 'details' ) ;
99
+ } ) ;
100
+
86
101
it ( 'should support custom CalendarGridHeader' , ( ) => {
87
102
let { getByRole} = render (
88
103
< Calendar aria-label = "Appointment date" >
You can’t perform that action at this time.
0 commit comments