@@ -17,7 +17,7 @@ import { UIInteractions, wait } from '../../test-utils/ui-interactions.spec';
17
17
import { By } from '@angular/platform-browser' ;
18
18
import { configureTestSuite } from '../../test-utils/configure-suite' ;
19
19
import { IgxToggleModule } from '../../directives/toggle/toggle.directive' ;
20
- import { IgxNumberFilteringOperand } from '../../data-operations/filtering-condition' ;
20
+ import { IgxNumberFilteringOperand , IgxStringFilteringOperand } from '../../data-operations/filtering-condition' ;
21
21
import { IgxHierarchicalTransactionService } from '../../services/transaction/igx-hierarchical-transaction' ;
22
22
import { IgxGridTransaction } from '../grid-base.directive' ;
23
23
import { IgxGridCellComponent } from '../grid' ;
@@ -1525,9 +1525,36 @@ describe('IgxTreeGrid - Integration #tGrid', () => {
1525
1525
expect ( searchResultsCount ) . toBe ( 2 ) ;
1526
1526
} ) ;
1527
1527
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 ( ) ;
1529
1546
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
+ } ) ;
1531
1558
1532
1559
it ( 'should not take into account pinned rows when changing items per page' , ( ) => { } ) ;
1533
1560
0 commit comments