@@ -2357,6 +2357,49 @@ describe('IgxGrid - Advanced Filtering', () => {
2357
2357
expect ( GridFunctions . getAdvancedFilteringTreeChildItems ( rootGroup , false ) . length ) . toBe ( 1 ) ;
2358
2358
expect ( GridFunctions . getAdvancedFilteringTreeChildExpressions ( rootGroup , true ) . length ) . toBe ( 1 ) ;
2359
2359
} ) ) ;
2360
+
2361
+ it ( 'Should select/deselect all child conditions and groups when pressing \'Enter\' on a group\'s operator line.' ,
2362
+ fakeAsync ( ( ) => {
2363
+ // Apply advanced filter through API.
2364
+ const tree = new FilteringExpressionsTree ( FilteringLogic . And ) ;
2365
+ tree . filteringOperands . push ( {
2366
+ fieldName : 'Downloads' , searchVal : 100 , condition : IgxNumberFilteringOperand . instance ( ) . condition ( 'greaterThan' )
2367
+ } ) ;
2368
+ const orTree = new FilteringExpressionsTree ( FilteringLogic . Or ) ;
2369
+ orTree . filteringOperands . push ( {
2370
+ fieldName : 'ProductName' , searchVal : 'angular' , condition : IgxStringFilteringOperand . instance ( ) . condition ( 'contains' ) ,
2371
+ ignoreCase : true
2372
+ } ) ;
2373
+ orTree . filteringOperands . push ( {
2374
+ fieldName : 'ProductName' , searchVal : 'script' , condition : IgxStringFilteringOperand . instance ( ) . condition ( 'contains' ) ,
2375
+ ignoreCase : true
2376
+ } ) ;
2377
+ tree . filteringOperands . push ( orTree ) ;
2378
+ grid . advancedFilteringExpressionsTree = tree ;
2379
+ fix . detectChanges ( ) ;
2380
+
2381
+ // Open Advanced Filtering dialog.
2382
+ GridFunctions . clickAdvancedFilteringButton ( fix ) ;
2383
+ fix . detectChanges ( ) ;
2384
+
2385
+ // Press 'Enter' on the root group's operator line
2386
+ // and verify that the root group and all of its children become selected.
2387
+ let rootOperatorLine = GridFunctions . getAdvancedFilteringTreeRootGroupOperatorLine ( fix ) ;
2388
+ UIInteractions . simulateKeyDownEvent ( rootOperatorLine , 'Enter' ) ;
2389
+ tick ( 200 ) ;
2390
+ fix . detectChanges ( ) ;
2391
+ verifyChildrenSelection ( GridFunctions . getAdvancedFilteringExpressionsContainer ( fix ) , true ) ;
2392
+ verifyContextMenuVisibility ( fix , true ) ;
2393
+
2394
+ // Press 'Enter' on the root group's operator line again
2395
+ // and verify that the root group and all of its children become unselected.
2396
+ rootOperatorLine = GridFunctions . getAdvancedFilteringTreeRootGroupOperatorLine ( fix ) ;
2397
+ UIInteractions . simulateKeyDownEvent ( rootOperatorLine , 'Enter' ) ;
2398
+ tick ( 200 ) ;
2399
+ fix . detectChanges ( ) ;
2400
+ verifyChildrenSelection ( GridFunctions . getAdvancedFilteringExpressionsContainer ( fix ) , false ) ;
2401
+ verifyContextMenuVisibility ( fix , false ) ;
2402
+ } ) ) ;
2360
2403
} ) ;
2361
2404
2362
2405
describe ( 'Localization' , ( ) => {
0 commit comments