@@ -20,29 +20,29 @@ describe('Navigation', () => {
2020 it ( 'renders prev2, prev, drill up, next and next2 buttons' , ( ) => {
2121 const { container } = render ( < Navigation { ...defaultProps } view = "month" /> ) ;
2222
23- const children = [ ...container . firstChild . children ] ;
23+ const children = [ ...container . firstElementChild . children ] ;
2424
2525 const [ prev2 , prev , drillUp , next , next2 ] = children ;
2626
2727 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' ) ;
3333 } ) ;
3434
3535 it ( 'renders prev, drill up, next and buttons only for century view' , ( ) => {
3636 const { container } = render ( < Navigation { ...defaultProps } view = "century" /> ) ;
3737
38- const children = [ ...container . firstChild . children ] ;
38+ const children = [ ...container . firstElementChild . children ] ;
3939
4040 const [ prev , drillUp , next ] = children ;
4141
4242 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' ) ;
4646 } ) ;
4747
4848 it ( 'displays proper title for month view' , ( ) => {
@@ -97,7 +97,7 @@ describe('Navigation', () => {
9797 /> ,
9898 ) ;
9999
100- const [ prev2 , prev , , next , next2 ] = [ ...container . firstChild . children ] ;
100+ const [ prev2 , prev , , next , next2 ] = [ ...container . firstElementChild . children ] ;
101101
102102 expect ( prev2 ) . toHaveTextContent ( 'prev2Label' ) ;
103103 expect ( prev ) . toHaveTextContent ( 'prevLabel' ) ;
@@ -110,7 +110,7 @@ describe('Navigation', () => {
110110 < Navigation { ...defaultProps } navigationAriaLive = "polite" view = "month" /> ,
111111 ) ;
112112
113- const [ , , navigation ] = [ ...container . firstChild . children ] ;
113+ const [ , , navigation ] = [ ...container . firstElementChild . children ] ;
114114
115115 expect ( navigation ) . toHaveAttribute ( 'aria-live' , 'polite' ) ;
116116 } ) ;
@@ -128,7 +128,7 @@ describe('Navigation', () => {
128128 /> ,
129129 ) ;
130130
131- const [ prev2 , prev , navigation , next , next2 ] = [ ...container . firstChild . children ] ;
131+ const [ prev2 , prev , navigation , next , next2 ] = [ ...container . firstElementChild . children ] ;
132132
133133 expect ( prev2 ) . toHaveAccessibleName ( 'prev2AriaLabel' ) ;
134134 expect ( prev ) . toHaveAccessibleName ( 'prevAriaLabel' ) ;
0 commit comments