Skip to content

Commit 48374c1

Browse files
committed
chore(*): Update pivot tests.
1 parent 9711ee9 commit 48374c1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import { Size } from '../common/enums';
2323
import { setElementSize } from '../../test-utils/helper-utils.spec';
2424
import { IgxPivotRowDimensionMrlRowComponent } from './pivot-row-dimension-mrl-row.component';
2525
import { IgxPivotRowDimensionContentComponent } from './pivot-row-dimension-content.component';
26-
import { flatten } from '../../core/utils';
2726

2827
const CSS_CLASS_LIST = 'igx-drop-down__list';
2928
const CSS_CLASS_ITEM = 'igx-drop-down__item';
@@ -3107,7 +3106,7 @@ describe('IgxPivotGrid #pivotGrid', () => {
31073106
];
31083107
pivotGrid.pipeTrigger++;
31093108
fixture.detectChanges();
3110-
const rowHeaders = fixture.debugElement.queryAll(
3109+
let rowHeaders = fixture.debugElement.queryAll(
31113110
By.directive(IgxPivotRowDimensionHeaderComponent));
31123111

31133112
const productsHeaderColumn = rowHeaders.filter(x => x.componentInstance.column.header === "ProductCategory")[0].nativeElement;
@@ -3119,8 +3118,14 @@ describe('IgxPivotGrid #pivotGrid', () => {
31193118
const sortIcon = productsHeaderColumn.querySelectorAll('igx-icon')[0];
31203119
sortIcon.click();
31213120
fixture.detectChanges();
3121+
sortIcon.click();
3122+
fixture.detectChanges();
31223123

3123-
expect(productRowContentsHeaders).toEqual( ['ProductCategory', 'Components', 'Clothing', 'Bikes', 'Accessories']);
3124+
rowHeaders = fixture.debugElement.queryAll(
3125+
By.directive(IgxPivotRowDimensionHeaderComponent));
3126+
const updatedProductRowContents = rowHeaders.filter(x => x.componentInstance.column.field === "ProductCategory");
3127+
const updatedProductRowContentsHeaders = updatedProductRowContents.map(x => x.componentInstance.column.header);
3128+
expect(updatedProductRowContentsHeaders).toEqual( ['ProductCategory', 'Components', 'Clothing', 'Bikes', 'Accessories']);
31243129
});
31253130

31263131
it("should allow select/deselect the correct rows on row header click.", () => {

0 commit comments

Comments
 (0)