@@ -112,28 +112,36 @@ describe('IgxPivotGrid - Keyboard navigation #pivotGrid', () => {
112
112
} ) ;
113
113
114
114
it ( 'should allow navigating between column headers' , ( ) => {
115
- const [ firstHeader , secondHeader ] = fixture . debugElement . queryAll (
116
- By . css ( `${ PIVOT_HEADER_ROW } ${ HEADER_CELL_CSS_CLASS } ` ) ) ;
115
+ let firstHeader = fixture . debugElement . queryAll (
116
+ By . css ( `${ PIVOT_HEADER_ROW } ${ HEADER_CELL_CSS_CLASS } ` ) ) [ 0 ] ;
117
117
UIInteractions . simulateClickAndSelectEvent ( firstHeader ) ;
118
118
fixture . detectChanges ( ) ;
119
119
120
+ firstHeader = fixture . debugElement . queryAll (
121
+ By . css ( `${ PIVOT_HEADER_ROW } ${ HEADER_CELL_CSS_CLASS } ` ) ) [ 0 ] ;
120
122
GridFunctions . verifyHeaderIsFocused ( firstHeader . parent ) ;
121
123
let activeCells = fixture . debugElement . queryAll ( By . css ( `${ ACTIVE_CELL_CSS_CLASS } ` ) ) ;
122
124
expect ( activeCells . length ) . toBe ( 1 ) ;
123
125
124
- UIInteractions . triggerKeyDownEvtUponElem ( 'ArrowRight' , firstHeader . nativeElement ) ;
126
+ UIInteractions . triggerKeyDownEvtUponElem ( 'ArrowRight' , pivotGrid . theadRow . nativeElement ) ;
125
127
fixture . detectChanges ( ) ;
128
+
129
+ const secondHeader = fixture . debugElement . queryAll (
130
+ By . css ( `${ PIVOT_HEADER_ROW } ${ HEADER_CELL_CSS_CLASS } ` ) ) [ 1 ] ;
126
131
GridFunctions . verifyHeaderIsFocused ( secondHeader . parent ) ;
127
132
activeCells = fixture . debugElement . queryAll ( By . css ( `${ ACTIVE_CELL_CSS_CLASS } ` ) ) ;
128
133
expect ( activeCells . length ) . toBe ( 1 ) ;
129
134
} ) ;
130
135
131
136
it ( 'should allow navigating from first to last column headers' , async ( ) => {
132
- const [ firstHeader ] = fixture . debugElement . queryAll (
133
- By . css ( `${ PIVOT_HEADER_ROW } ${ HEADER_CELL_CSS_CLASS } ` ) ) ;
137
+ let firstHeader = fixture . debugElement . queryAll (
138
+ By . css ( `${ PIVOT_HEADER_ROW } ${ HEADER_CELL_CSS_CLASS } ` ) ) [ 0 ] ;
134
139
UIInteractions . simulateClickAndSelectEvent ( firstHeader ) ;
135
140
fixture . detectChanges ( ) ;
136
141
142
+ firstHeader = fixture . debugElement . queryAll (
143
+ By . css ( `${ PIVOT_HEADER_ROW } ${ HEADER_CELL_CSS_CLASS } ` ) ) [ 0 ] ;
144
+
137
145
GridFunctions . verifyHeaderIsFocused ( firstHeader . parent ) ;
138
146
let activeCells = fixture . debugElement . queryAll ( By . css ( `${ ACTIVE_CELL_CSS_CLASS } ` ) ) ;
139
147
expect ( activeCells . length ) . toBe ( 1 ) ;
0 commit comments