@@ -1488,6 +1488,47 @@ describe('IgxTreeGrid - Selection #tGrid', () => {
14881488 TreeGridFunctions . verifyRowByIndexSelectionAndCheckboxState ( fix , 3 , true , true ) ;
14891489 } ) ;
14901490
1491+ it ( `Parent with two or more children. Select parent. Filter out one of the children. Deselect all the others -> children
1492+ and parent checkbox state becomes deselected. Filter the other child back in. This child should remain selected.
1493+ Parent checkbox state should be indeterminate.` , fakeAsync ( ( ) => {
1494+ treeGrid . selectRows ( [ 147 ] , true ) ;
1495+ fix . detectChanges ( ) ;
1496+
1497+ expect ( getVisibleSelectedRows ( fix ) . length ) . toBe ( 7 ) ;
1498+
1499+ const expressionTree = new FilteringExpressionsTree ( FilteringLogic . And , 'ID' ) ;
1500+ expressionTree . filteringOperands = [
1501+ {
1502+ condition : IgxNumberFilteringOperand . instance ( ) . condition ( 'doesNotEqual' ) ,
1503+ fieldName : 'ID' ,
1504+ searchVal : 957
1505+ } ,
1506+ ] ;
1507+ treeGrid . filter ( 'ID' , null , expressionTree ) ;
1508+
1509+ fix . detectChanges ( ) ;
1510+ tick ( 100 ) ;
1511+
1512+ expect ( getVisibleSelectedRows ( fix ) . length ) . toBe ( 6 ) ;
1513+
1514+ treeGrid . deselectRows ( [ 475 , 317 ] ) ;
1515+ fix . detectChanges ( ) ;
1516+
1517+ expect ( getVisibleSelectedRows ( fix ) . length ) . toBe ( 0 ) ;
1518+ TreeGridFunctions . verifyRowByIndexSelectionAndCheckboxState ( fix , 0 , false , false ) ;
1519+
1520+ treeGrid . clearFilter ( ) ;
1521+
1522+ tick ( 1000 ) ;
1523+ fix . detectChanges ( ) ;
1524+
1525+ expect ( getVisibleSelectedRows ( fix ) . length ) . toBe ( 1 ) ;
1526+ expect ( treeGrid . selectionService . indeterminateRows . size ) . toBe ( 1 ) ;
1527+ TreeGridFunctions . verifyHeaderCheckboxSelection ( fix , null ) ;
1528+ TreeGridFunctions . verifyRowByIndexSelectionAndCheckboxState ( fix , 2 , true , true ) ;
1529+ TreeGridFunctions . verifyRowByIndexSelectionAndCheckboxState ( fix , 0 , null , null ) ;
1530+ } ) ) ;
1531+
14911532 it ( `Parent in indeterminate state. Filter out its children -> parent not selected. Select parent and add new child.
14921533 Parent -> not selected. Revert filtering so that previous records are back in the view and parent should become in
14931534 indeterminate state because one of it children is selected` , fakeAsync ( ( ) => {
0 commit comments