From 35098687cca6728ad47bb2e81c65327601be43d1 Mon Sep 17 00:00:00 2001 From: VDyulgerov Date: Fri, 1 Oct 2021 13:36:00 +0300 Subject: [PATCH] fix(grid): fix 4 buggy tests --- .../src/lib/grids/grid/grid-row-pinning.spec.ts | 8 ++++---- .../hierarchical-grid.integration.spec.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/projects/igniteui-angular/src/lib/grids/grid/grid-row-pinning.spec.ts b/projects/igniteui-angular/src/lib/grids/grid/grid-row-pinning.spec.ts index 440395f7194..aabce35ce7e 100644 --- a/projects/igniteui-angular/src/lib/grids/grid/grid-row-pinning.spec.ts +++ b/projects/igniteui-angular/src/lib/grids/grid/grid-row-pinning.spec.ts @@ -461,13 +461,13 @@ describe('Row Pinning #grid', () => { fix.detectChanges(); expect(grid.gridAPI.get_row_by_index(0).rowID).toBe(fix.componentInstance.data[1]); - expect(grid.gridAPI.get_row_by_index(1).rowID).toBe(fix.componentInstance.data[5]); + expect(grid.gridAPI.get_row_by_index(1).rowID).toBe(fix.componentInstance.data[4]); grid.sort({ fieldName: 'ID', dir: SortingDirection.Desc, ignoreCase: false }); fix.detectChanges(); // check pinned rows data is sorted - expect(grid.gridAPI.get_row_by_index(0).rowID).toBe(fix.componentInstance.data[5]); + expect(grid.gridAPI.get_row_by_index(0).rowID).toBe(fix.componentInstance.data[4]); expect(grid.gridAPI.get_row_by_index(1).rowID).toBe(fix.componentInstance.data[1]); // check unpinned rows data is sorted @@ -627,14 +627,14 @@ describe('Row Pinning #grid', () => { let rows = grid.rowList.toArray(); - [1, 2, 1, 2, 3, 4, 5].forEach((x, index) => expect(rows[index].cells.first.value).toEqual(x)); + [1, 1, 2, 3, 4, 5].forEach((x, index) => expect(rows[index].cells.first.value).toEqual(x)); grid.paginate(2); fix.detectChanges(); rows = grid.rowList.toArray(); - [1, 2, 11, 12].forEach((x, index) => expect(rows[index].cells.first.value).toEqual(x)); + [1, 11, 12].forEach((x, index) => expect(rows[index].cells.first.value).toEqual(x)); }); }); diff --git a/projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid.integration.spec.ts b/projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid.integration.spec.ts index 704a0d1beea..cdb6618dd43 100644 --- a/projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid.integration.spec.ts +++ b/projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid.integration.spec.ts @@ -1153,14 +1153,14 @@ describe('IgxHierarchicalGrid Integration #hGrid', () => { let rows = hierarchicalGrid.rowList.toArray(); - [0, 1, 0, 1, 2, 3, 4].forEach((x, index) => expect(parseInt(rows[index].cells.first.value, 10)).toEqual(x)); + [0, 0, 1, 2, 3, 4, 5].forEach((x, index) => expect(parseInt(rows[index].cells.first.value, 10)).toEqual(x)); hierarchicalGrid.paginate(6); fixture.detectChanges(); rows = hierarchicalGrid.rowList.toArray(); - [0, 1, 36, 37, 38, 39].forEach((x, index) => expect(parseInt(rows[index].cells.first.value, 10)).toEqual(x)); + [0, 36, 37, 38, 39].forEach((x, index) => expect(parseInt(rows[index].cells.first.value, 10)).toEqual(x)); }); }); });