@@ -20,29 +20,29 @@ describe('Navigation', () => {
20
20
it ( 'renders prev2, prev, drill up, next and next2 buttons' , ( ) => {
21
21
const { container } = render ( < Navigation { ...defaultProps } view = "month" /> ) ;
22
22
23
- const children = [ ...container . firstChild . children ] ;
23
+ const children = [ ...container . firstElementChild . children ] ;
24
24
25
25
const [ prev2 , prev , drillUp , next , next2 ] = children ;
26
26
27
27
expect ( children ) . toHaveLength ( 5 ) ;
28
- expect ( prev2 . type ) . toBe ( 'button' ) ;
29
- expect ( prev . type ) . toBe ( 'button' ) ;
30
- expect ( drillUp . type ) . toBe ( 'button' ) ;
31
- expect ( next . type ) . toBe ( 'button' ) ;
32
- expect ( next2 . type ) . toBe ( 'button' ) ;
28
+ expect ( prev2 . getAttribute ( ' type' ) ) . toBe ( 'button' ) ;
29
+ expect ( prev . getAttribute ( ' type' ) ) . toBe ( 'button' ) ;
30
+ expect ( drillUp . getAttribute ( ' type' ) ) . toBe ( 'button' ) ;
31
+ expect ( next . getAttribute ( ' type' ) ) . toBe ( 'button' ) ;
32
+ expect ( next2 . getAttribute ( ' type' ) ) . toBe ( 'button' ) ;
33
33
} ) ;
34
34
35
35
it ( 'renders prev, drill up, next and buttons only for century view' , ( ) => {
36
36
const { container } = render ( < Navigation { ...defaultProps } view = "century" /> ) ;
37
37
38
- const children = [ ...container . firstChild . children ] ;
38
+ const children = [ ...container . firstElementChild . children ] ;
39
39
40
40
const [ prev , drillUp , next ] = children ;
41
41
42
42
expect ( children ) . toHaveLength ( 3 ) ;
43
- expect ( prev . type ) . toBe ( 'button' ) ;
44
- expect ( drillUp . type ) . toBe ( 'button' ) ;
45
- expect ( next . type ) . toBe ( 'button' ) ;
43
+ expect ( prev . getAttribute ( ' type' ) ) . toBe ( 'button' ) ;
44
+ expect ( drillUp . getAttribute ( ' type' ) ) . toBe ( 'button' ) ;
45
+ expect ( next . getAttribute ( ' type' ) ) . toBe ( 'button' ) ;
46
46
} ) ;
47
47
48
48
it ( 'displays proper title for month view' , ( ) => {
@@ -97,7 +97,7 @@ describe('Navigation', () => {
97
97
/> ,
98
98
) ;
99
99
100
- const [ prev2 , prev , , next , next2 ] = [ ...container . firstChild . children ] ;
100
+ const [ prev2 , prev , , next , next2 ] = [ ...container . firstElementChild . children ] ;
101
101
102
102
expect ( prev2 ) . toHaveTextContent ( 'prev2Label' ) ;
103
103
expect ( prev ) . toHaveTextContent ( 'prevLabel' ) ;
@@ -110,7 +110,7 @@ describe('Navigation', () => {
110
110
< Navigation { ...defaultProps } navigationAriaLive = "polite" view = "month" /> ,
111
111
) ;
112
112
113
- const [ , , navigation ] = [ ...container . firstChild . children ] ;
113
+ const [ , , navigation ] = [ ...container . firstElementChild . children ] ;
114
114
115
115
expect ( navigation ) . toHaveAttribute ( 'aria-live' , 'polite' ) ;
116
116
} ) ;
@@ -128,7 +128,7 @@ describe('Navigation', () => {
128
128
/> ,
129
129
) ;
130
130
131
- const [ prev2 , prev , navigation , next , next2 ] = [ ...container . firstChild . children ] ;
131
+ const [ prev2 , prev , navigation , next , next2 ] = [ ...container . firstElementChild . children ] ;
132
132
133
133
expect ( prev2 ) . toHaveAccessibleName ( 'prev2AriaLabel' ) ;
134
134
expect ( prev ) . toHaveAccessibleName ( 'prevAriaLabel' ) ;
0 commit comments