Skip to content

Commit 25ecb4f

Browse files
committed
test(pivot): Add test for showing one aggregations drop-down at a time
1 parent 5395368 commit 25ecb4f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,29 @@ describe('Basic IgxPivotGrid #pivotGrid', () => {
507507
expect(pivotGrid.gridAPI.get_cell_by_index(0, 'USA').value).toBe(0);
508508
expect(pivotGrid.gridAPI.get_cell_by_index(0, 'Uruguay').value).toBe(242.08);
509509
});
510+
it('should show one aggregations drop-down at a time', () => {
511+
const pivotGrid = fixture.componentInstance.pivotGrid;
512+
pivotGrid.width = '1500px';
513+
fixture.detectChanges();
514+
const headerRow = fixture.nativeElement.querySelector('igx-pivot-header-row');
515+
const valueChipUnitsSold = headerRow.querySelector('igx-chip[id="UnitsSold"]');
516+
517+
const aggregatesIconUnitsSold = valueChipUnitsSold.querySelectorAll('igx-icon')[1];
518+
aggregatesIconUnitsSold.click();
519+
fixture.detectChanges();
520+
521+
let dropDown = fixture.debugElement.queryAll(By.css(`.${CSS_CLASS_LIST}`));
522+
expect(dropDown.length).toBe(1);
523+
524+
const valueChipUnitPrice = headerRow.querySelector('igx-chip[id="UnitPrice"]');
525+
526+
const aggregatesIconUnitPrice = valueChipUnitPrice.querySelectorAll('igx-icon')[1];
527+
aggregatesIconUnitPrice.click();
528+
fixture.detectChanges();
529+
530+
dropDown = fixture.debugElement.queryAll(By.css(`.${CSS_CLASS_LIST}`));
531+
expect(dropDown.length).toBe(1);
532+
});
510533
});
511534
});
512535

0 commit comments

Comments
 (0)