@@ -485,9 +485,10 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
485
485
GridFunctions . clickFilterCellChip ( fix , columnName ) ;
486
486
GridFunctions . resetFilterRow ( fix ) ;
487
487
488
- expect ( grid . filtering . emit ) . toHaveBeenCalledWith ( { owner : grid , cancel : false , filteringExpressions : null } ) ;
488
+ const emptyFilter = new FilteringExpressionsTree ( null , columnName ) ;
489
+ expect ( grid . filtering . emit ) . toHaveBeenCalledWith ( { owner : grid , cancel : false , filteringExpressions : emptyFilter } ) ;
489
490
expect ( grid . filtering . emit ) . toHaveBeenCalledTimes ( 2 ) ;
490
- expect ( grid . filteringDone . emit ) . toHaveBeenCalledWith ( null ) ;
491
+ expect ( grid . filteringDone . emit ) . toHaveBeenCalledWith ( emptyFilter ) ;
491
492
expect ( grid . filteringDone . emit ) . toHaveBeenCalledTimes ( 2 ) ;
492
493
493
494
const filterUiRow = fix . debugElement . query ( By . css ( FILTER_UI_ROW ) ) ;
@@ -512,9 +513,10 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
512
513
tick ( 100 ) ;
513
514
fix . detectChanges ( ) ;
514
515
515
- const args = { owner : grid , cancel : false , filteringExpressions : null } ;
516
+ const emptyFilter = new FilteringExpressionsTree ( null , columnName ) ;
517
+ const args = { owner : grid , cancel : false , filteringExpressions : emptyFilter } ;
516
518
expect ( grid . filtering . emit ) . toHaveBeenCalledWith ( args ) ;
517
- expect ( grid . filteringDone . emit ) . toHaveBeenCalledWith ( null ) ;
519
+ expect ( grid . filteringDone . emit ) . toHaveBeenCalledWith ( emptyFilter ) ;
518
520
} ) ) ;
519
521
520
522
it ( 'Removing second condition removes the And/Or button' , fakeAsync ( ( ) => {
@@ -826,13 +828,14 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
826
828
spyOn ( grid . filtering , 'emit' ) ;
827
829
spyOn ( grid . filteringDone , 'emit' ) ;
828
830
829
- grid . filter ( 'ProductName' , 'I' , IgxStringFilteringOperand . instance ( ) . condition ( 'startsWith' ) ) ;
831
+ const columnName = 'ProductName' ;
832
+ grid . filter ( columnName , 'I' , IgxStringFilteringOperand . instance ( ) . condition ( 'startsWith' ) ) ;
830
833
tick ( 30 ) ;
831
834
fix . detectChanges ( ) ;
832
835
833
836
expect ( grid . rowList . length ) . toEqual ( 2 ) ;
834
837
835
- const filteringExpressions = grid . filteringExpressionsTree . find ( 'ProductName' ) as FilteringExpressionsTree ;
838
+ const filteringExpressions = grid . filteringExpressionsTree . find ( columnName ) as FilteringExpressionsTree ;
836
839
const args = { owner : grid , cancel : false , filteringExpressions } ;
837
840
expect ( grid . filtering . emit ) . toHaveBeenCalledWith ( args ) ;
838
841
expect ( grid . filtering . emit ) . toHaveBeenCalledTimes ( 1 ) ;
@@ -849,10 +852,11 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
849
852
850
853
expect ( grid . rowList . length ) . toEqual ( 8 ) ;
851
854
852
- args . filteringExpressions = null ;
855
+ const emptyFilter = new FilteringExpressionsTree ( null , columnName ) ;
856
+ args . filteringExpressions = emptyFilter ;
853
857
expect ( grid . filtering . emit ) . toHaveBeenCalledWith ( args ) ;
854
858
expect ( grid . filtering . emit ) . toHaveBeenCalledTimes ( 2 ) ;
855
- expect ( grid . filteringDone . emit ) . toHaveBeenCalledWith ( null ) ;
859
+ expect ( grid . filteringDone . emit ) . toHaveBeenCalledWith ( emptyFilter ) ;
856
860
expect ( grid . filteringDone . emit ) . toHaveBeenCalledTimes ( 2 ) ;
857
861
} ) ) ;
858
862
0 commit comments