@@ -17,7 +17,7 @@ import { UIInteractions, wait } from '../../test-utils/ui-interactions.spec';
1717import { By } from '@angular/platform-browser' ;
1818import { configureTestSuite } from '../../test-utils/configure-suite' ;
1919import { IgxToggleModule } from '../../directives/toggle/toggle.directive' ;
20- import { IgxNumberFilteringOperand } from '../../data-operations/filtering-condition' ;
20+ import { IgxNumberFilteringOperand , IgxStringFilteringOperand } from '../../data-operations/filtering-condition' ;
2121import { IgxHierarchicalTransactionService } from '../../services/transaction/igx-hierarchical-transaction' ;
2222import { IgxGridTransaction } from '../grid-base.directive' ;
2323import { IgxGridCellComponent } from '../grid' ;
@@ -1525,9 +1525,36 @@ describe('IgxTreeGrid - Integration #tGrid', () => {
15251525 expect ( searchResultsCount ) . toBe ( 2 ) ;
15261526 } ) ;
15271527
1528- it ( 'should apply filtering to both pinned and unpinned rows' , ( ) => { } ) ;
1528+ it ( 'should apply filtering to both pinned and unpinned rows' , ( ) => {
1529+ treeGrid . pinRow ( 147 ) ;
1530+ treeGrid . pinRow ( 711 ) ;
1531+ fix . detectChanges ( ) ;
1532+
1533+ treeGrid . filter ( 'ID' , 147 , IgxStringFilteringOperand . instance ( ) . condition ( 'contains' ) , false ) ;
1534+ fix . detectChanges ( ) ;
1535+
1536+ const gridFilterData = treeGrid . filteredData ;
1537+ expect ( gridFilterData . length ) . toBe ( 2 ) ;
1538+ expect ( gridFilterData [ 0 ] . ID ) . toBe ( 147 ) ;
1539+ expect ( gridFilterData [ 1 ] . recordRef . ID ) . toBe ( 147 ) ;
1540+ } ) ;
1541+
1542+ it ( 'should apply sorting to both pinned and unpinned rows' , ( ) => {
1543+ treeGrid . pinRow ( 147 ) ;
1544+ treeGrid . pinRow ( 711 ) ;
1545+ fix . detectChanges ( ) ;
15291546
1530- it ( 'should apply sorting to both pinned and unpinned rows' , ( ) => { } ) ;
1547+ expect ( treeGrid . getRowByIndex ( 0 ) . rowID ) . toBe ( 147 ) ;
1548+ expect ( treeGrid . getRowByIndex ( 1 ) . rowID ) . toBe ( 711 ) ;
1549+ expect ( treeGrid . getRowByIndex ( 2 ) . rowID ) . toBe ( 147 ) ;
1550+
1551+ treeGrid . sort ( { fieldName : 'ID' , dir : SortingDirection . Desc , ignoreCase : false } ) ;
1552+ fix . detectChanges ( ) ;
1553+
1554+ expect ( treeGrid . getRowByIndex ( 0 ) . rowID ) . toBe ( 711 ) ;
1555+ expect ( treeGrid . getRowByIndex ( 1 ) . rowID ) . toBe ( 147 ) ;
1556+ expect ( treeGrid . getRowByIndex ( 2 ) . rowID ) . toBe ( 847 ) ;
1557+ } ) ;
15311558
15321559 it ( 'should not take into account pinned rows when changing items per page' , ( ) => { } ) ;
15331560
0 commit comments