Skip to content

Commit e7a749f

Browse files
committed
test(TreeGrid): header checkbox state should be correct when add row #7582
1 parent 130f8eb commit e7a749f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,17 @@ describe('IgxTreeGrid - Selection #tGrid', () => {
622622
TreeGridFunctions.verifyHeaderCheckboxSelection(fix, true);
623623
});
624624

625+
it('should have correct header checkbox when add a row and then selectAll rows', () => {
626+
treeGrid.addRow({ ID: 13, Name: 'Michael Cooper', Age: 33, OnPTO: false }, 317);
627+
fix.detectChanges();
628+
629+
TreeGridFunctions.clickHeaderRowSelectionCheckbox(fix);
630+
fix.detectChanges();
631+
632+
expect(treeGrid.selectedRows.length).toBeGreaterThan(treeGrid.flatData.length);
633+
TreeGridFunctions.verifyHeaderCheckboxSelection(fix, true);
634+
});
635+
625636
it('should have correct header checkbox when add a row and undo transaction', fakeAsync(() => {
626637
treeGrid.addRow({ ID: 13, Name: 'Michael Cooper', Age: 33, OnPTO: false }, 317);
627638
tick();

0 commit comments

Comments
 (0)