File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,22 @@ describe('DayPickerNavigation', () => {
17
17
const wrapper = shallow ( < DayPickerNavigation orientation = { VERTICAL_SCROLLABLE } /> ) . dive ( ) ;
18
18
expect ( wrapper . find ( '[role="button"]' ) ) . to . have . lengthOf ( 1 ) ;
19
19
} ) ;
20
+
21
+ it ( 'tabindex is present when the default buttons are used' , ( ) => {
22
+ const wrapper = shallow ( < DayPickerNavigation /> ) . dive ( ) ;
23
+ const prevMonthButton = wrapper . find ( '[role="button"]' ) . at ( 0 ) ;
24
+ const nextMonthButton = wrapper . find ( '[role="button"]' ) . at ( 1 ) ;
25
+ expect ( prevMonthButton . prop ( 'tabIndex' ) ) . to . equal ( '0' ) ;
26
+ expect ( nextMonthButton . prop ( 'tabIndex' ) ) . to . equal ( '0' ) ;
27
+ } ) ;
28
+
29
+ it ( 'tabindex is present when custom buttons are used' , ( ) => {
30
+ const wrapper = shallow ( < DayPickerNavigation navNext = { < div /> } navPrev = { < div /> } /> ) . dive ( ) ;
31
+ const prevMonthButton = wrapper . find ( '[role="button"]' ) . at ( 0 ) ;
32
+ const nextMonthButton = wrapper . find ( '[role="button"]' ) . at ( 1 ) ;
33
+ expect ( prevMonthButton . prop ( 'tabIndex' ) ) . to . equal ( '0' ) ;
34
+ expect ( nextMonthButton . prop ( 'tabIndex' ) ) . to . equal ( '0' ) ;
35
+ } ) ;
20
36
} ) ;
21
37
22
38
describe ( 'interactions' , ( ) => {
You can’t perform that action at this time.
0 commit comments