@@ -8,8 +8,8 @@ import { IgxPivotGridMultipleRowComponent } from '../../test-utils/pivot-grid-sa
8
8
import { UIInteractions } from '../../test-utils/ui-interactions.spec' ;
9
9
10
10
const PIVOT_TBODY_CSS_CLASS = '.igx-grid__tbody' ;
11
+ const PIVOT_ROW_DIMENSION_CONTENT = 'igx-pivot-row-dimension-content' ;
11
12
const PIVOT_HEADER_ROW = 'igx-pivot-header-row' ;
12
- const COLUMNS_HEADER_CSS_CLASS = '.igx-grid-thead__wrapper' ;
13
13
const HEADER_CELL_CSS_CLASS = '.igx-grid-th' ;
14
14
const ACTIVE_CELL_CSS_CLASS = '.igx-grid-th--active' ;
15
15
@@ -35,7 +35,7 @@ describe('IgxPivotGrid - Keyboard navigation #pivotGrid', () => {
35
35
36
36
it ( 'should allow navigating between row headers' , ( ) => {
37
37
const [ firstCell , secondCell ] = fixture . debugElement . queryAll (
38
- By . css ( `${ PIVOT_TBODY_CSS_CLASS } ${ COLUMNS_HEADER_CSS_CLASS } ${ HEADER_CELL_CSS_CLASS } ` ) ) ;
38
+ By . css ( `${ PIVOT_TBODY_CSS_CLASS } ${ PIVOT_ROW_DIMENSION_CONTENT } ${ HEADER_CELL_CSS_CLASS } ` ) ) ;
39
39
UIInteractions . simulateClickAndSelectEvent ( firstCell ) ;
40
40
fixture . detectChanges ( ) ;
41
41
@@ -52,7 +52,7 @@ describe('IgxPivotGrid - Keyboard navigation #pivotGrid', () => {
52
52
53
53
it ( 'should not go outside of the boundaries of the row dimensions content' , ( ) => {
54
54
const [ firstCell , _ , thirdCell ] = fixture . debugElement . queryAll (
55
- By . css ( `${ PIVOT_TBODY_CSS_CLASS } ${ PIVOT_HEADER_ROW } ${ HEADER_CELL_CSS_CLASS } ` ) ) ;
55
+ By . css ( `${ PIVOT_TBODY_CSS_CLASS } ${ PIVOT_ROW_DIMENSION_CONTENT } ${ HEADER_CELL_CSS_CLASS } ` ) ) ;
56
56
UIInteractions . simulateClickAndSelectEvent ( firstCell ) ;
57
57
fixture . detectChanges ( ) ;
58
58
@@ -76,17 +76,17 @@ describe('IgxPivotGrid - Keyboard navigation #pivotGrid', () => {
76
76
77
77
it ( 'should allow navigating from first to last row headers in a row(Home/End)' , ( ) => {
78
78
const [ firstCell , _ , thirdCell ] = fixture . debugElement . queryAll (
79
- By . css ( `${ PIVOT_TBODY_CSS_CLASS } ${ PIVOT_HEADER_ROW } ${ HEADER_CELL_CSS_CLASS } ` ) ) ;
79
+ By . css ( `${ PIVOT_TBODY_CSS_CLASS } ${ PIVOT_ROW_DIMENSION_CONTENT } ${ HEADER_CELL_CSS_CLASS } ` ) ) ;
80
80
UIInteractions . simulateClickAndSelectEvent ( firstCell ) ;
81
81
fixture . detectChanges ( ) ;
82
82
83
- UIInteractions . triggerKeyDownEvtUponElem ( 'End' , firstCell . nativeElement ) ;
83
+ UIInteractions . triggerKeyDownEvtUponElem ( 'End' , pivotGrid . theadRow . nativeElement ) ;
84
84
fixture . detectChanges ( ) ;
85
85
GridFunctions . verifyHeaderIsFocused ( thirdCell . parent ) ;
86
86
let activeCells = fixture . debugElement . queryAll ( By . css ( `${ ACTIVE_CELL_CSS_CLASS } ` ) ) ;
87
87
expect ( activeCells . length ) . toBe ( 1 ) ;
88
88
89
- UIInteractions . triggerKeyDownEvtUponElem ( 'Home' , thirdCell . nativeElement ) ;
89
+ UIInteractions . triggerKeyDownEvtUponElem ( 'Home' , pivotGrid . theadRow . nativeElement ) ;
90
90
fixture . detectChanges ( ) ;
91
91
GridFunctions . verifyHeaderIsFocused ( firstCell . parent ) ;
92
92
activeCells = fixture . debugElement . queryAll ( By . css ( `${ ACTIVE_CELL_CSS_CLASS } ` ) ) ;
@@ -95,17 +95,16 @@ describe('IgxPivotGrid - Keyboard navigation #pivotGrid', () => {
95
95
96
96
it ( 'should allow navigating from first to last row headers(Ctrl + End)' , ( ) => {
97
97
const [ firstCell ] = fixture . debugElement . queryAll (
98
- By . css ( `${ PIVOT_TBODY_CSS_CLASS } ${ PIVOT_HEADER_ROW } ${ HEADER_CELL_CSS_CLASS } ` ) ) ;
98
+ By . css ( `${ PIVOT_TBODY_CSS_CLASS } ${ PIVOT_ROW_DIMENSION_CONTENT } ${ HEADER_CELL_CSS_CLASS } ` ) ) ;
99
99
UIInteractions . simulateClickAndSelectEvent ( firstCell ) ;
100
100
fixture . detectChanges ( ) ;
101
101
102
- UIInteractions . triggerKeyDownEvtUponElem ( 'End' , firstCell . nativeElement , false , false , false , true ) ;
102
+ UIInteractions . triggerKeyDownEvtUponElem ( 'End' , pivotGrid . theadRow . nativeElement , false , false , false , true ) ;
103
103
fixture . detectChanges ( ) ;
104
104
105
105
const allCells = fixture . debugElement . queryAll (
106
- By . css ( `${ PIVOT_TBODY_CSS_CLASS } ${ PIVOT_HEADER_ROW } ${ HEADER_CELL_CSS_CLASS } ` ) ) ;
106
+ By . css ( `${ PIVOT_TBODY_CSS_CLASS } ${ PIVOT_ROW_DIMENSION_CONTENT } ${ HEADER_CELL_CSS_CLASS } ` ) ) ;
107
107
const lastCell = allCells [ allCells . length - 1 ] ;
108
- fixture . detectChanges ( ) ;
109
108
GridFunctions . verifyHeaderIsFocused ( lastCell . parent ) ;
110
109
const activeCells = fixture . debugElement . queryAll ( By . css ( `${ ACTIVE_CELL_CSS_CLASS } ` ) ) ;
111
110
expect ( activeCells . length ) . toBe ( 1 ) ;
@@ -119,7 +118,7 @@ describe('IgxPivotGrid - Keyboard navigation #pivotGrid', () => {
119
118
120
119
it ( 'should allow navigating between column headers' , ( ) => {
121
120
const [ firstHeader , secondHeader ] = fixture . debugElement . queryAll (
122
- By . css ( `${ COLUMNS_HEADER_CSS_CLASS } ${ HEADER_CELL_CSS_CLASS } ` ) ) ;
121
+ By . css ( `${ PIVOT_HEADER_ROW } ${ HEADER_CELL_CSS_CLASS } ` ) ) ;
123
122
UIInteractions . simulateClickAndSelectEvent ( firstHeader ) ;
124
123
fixture . detectChanges ( ) ;
125
124
@@ -135,20 +134,20 @@ describe('IgxPivotGrid - Keyboard navigation #pivotGrid', () => {
135
134
} ) ;
136
135
it ( 'should allow navigating from first to last column headers' , ( ) => {
137
136
const [ firstHeader ] = fixture . debugElement . queryAll (
138
- By . css ( `${ COLUMNS_HEADER_CSS_CLASS } ${ HEADER_CELL_CSS_CLASS } ` ) ) ;
137
+ By . css ( `${ PIVOT_HEADER_ROW } ${ HEADER_CELL_CSS_CLASS } ` ) ) ;
139
138
UIInteractions . simulateClickAndSelectEvent ( firstHeader ) ;
140
139
fixture . detectChanges ( ) ;
141
140
142
141
GridFunctions . verifyHeaderIsFocused ( firstHeader . parent ) ;
143
142
let activeCells = fixture . debugElement . queryAll ( By . css ( `${ ACTIVE_CELL_CSS_CLASS } ` ) ) ;
144
143
expect ( activeCells . length ) . toBe ( 1 ) ;
145
144
146
- UIInteractions . triggerKeyDownEvtUponElem ( 'End' , firstHeader . nativeElement ) ;
145
+ UIInteractions . triggerKeyDownEvtUponElem ( 'End' , pivotGrid . theadRow . nativeElement ) ;
147
146
fixture . detectChanges ( ) ;
148
147
149
148
const allHeaders = fixture . debugElement . queryAll (
150
- By . css ( `${ COLUMNS_HEADER_CSS_CLASS } ${ HEADER_CELL_CSS_CLASS } ` ) ) ;
151
- const lastHeader = allHeaders [ length - 1 ] ;
149
+ By . css ( `${ PIVOT_HEADER_ROW } ${ HEADER_CELL_CSS_CLASS } ` ) ) ;
150
+ const lastHeader = allHeaders [ allHeaders . length - 1 ] ;
152
151
GridFunctions . verifyHeaderIsFocused ( lastHeader . parent ) ;
153
152
activeCells = fixture . debugElement . queryAll ( By . css ( `${ ACTIVE_CELL_CSS_CLASS } ` ) ) ;
154
153
expect ( activeCells . length ) . toBe ( 1 ) ;
0 commit comments