Skip to content

Commit 0b8a49b

Browse files
committed
test(grid): fix pinning tests #8119
1 parent 1aa0d48 commit 0b8a49b

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

projects/igniteui-angular/src/lib/grids/grid/grid.pinning.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,18 +191,18 @@ describe('IgxGrid - Column Pinning #grid', () => {
191191

192192
it('should correctly initialize pinned columns z-index values.', () => {
193193

194-
const headers = GridFunctions.getColumnGroupHeaders(fix);
194+
const headers = GridFunctions.getColumnHeaders(fix);
195195

196196
// First two headers are pinned
197-
expect(headers[0].componentInstance.zIndex).toEqual(9999);
198-
expect(headers[1].componentInstance.zIndex).toEqual(9998);
197+
expect(headers[0].parent.componentInstance.zIndex).toEqual(9999);
198+
expect(headers[1].parent.componentInstance.zIndex).toEqual(9998);
199199

200200
grid.pinColumn('Region');
201201
fix.detectChanges();
202202

203203
// First three headers are pinned
204-
const secondColumnGroupHeader = GridFunctions.getColumnGroupHeaders(fix)[2];
205-
expect(secondColumnGroupHeader.componentInstance.zIndex).toEqual(9997);
204+
const secondColumnGroupHeader = GridFunctions.getColumnHeaders(fix)[2];
205+
expect(secondColumnGroupHeader.parent.componentInstance.zIndex).toEqual(9997);
206206
});
207207

208208
it('should not pin/unpin columns which are already pinned/unpinned', () => {

projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid.integration.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -730,20 +730,20 @@ describe('IgxHierarchicalGrid Integration #hGrid', () => {
730730
hierarchicalGrid.expandRow(hierarchicalGrid.dataRowList.first.rowID);
731731

732732
const childGrid = hierarchicalGrid.hgridAPI.getChildGrids(false)[0];
733-
let childHeader = GridFunctions.getColumnGroupHeaders(fixture)[4];
733+
let childHeader = GridFunctions.getColumnHeaders(fixture)[3];
734734
const firstHeaderIcon = childHeader.query(By.css('.igx-icon'));
735735

736-
expect(GridFunctions.isHeaderPinned(childHeader)).toBeFalsy();
736+
expect(GridFunctions.isHeaderPinned(childHeader.parent)).toBeFalsy();
737737
expect(childGrid.columnList.first.pinned).toBeFalsy();
738738
expect(firstHeaderIcon).toBeDefined();
739739

740740
UIInteractions.simulateClickAndSelectEvent(firstHeaderIcon);
741741
fixture.detectChanges();
742742
tick();
743743

744-
childHeader = GridFunctions.getColumnGroupHeaders(fixture)[4];
744+
childHeader = GridFunctions.getColumnHeaders(fixture)[3];
745745
expect(childGrid.columnList.first.pinned).toBeTruthy();
746-
expect(GridFunctions.isHeaderPinned(childHeader)).toBeTruthy();
746+
expect(GridFunctions.isHeaderPinned(childHeader.parent)).toBeTruthy();
747747
}));
748748

749749
it('should be applied correctly for child grid with multi-column header.', fakeAsync(() => {

0 commit comments

Comments
 (0)