@@ -2064,6 +2064,33 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
2064
2064
expect ( grid . filteredData ) . toBeNull ( ) ;
2065
2065
} ) ) ;
2066
2066
2067
+ it ( 'should not reset expression when input is cleared' , fakeAsync ( ( ) => {
2068
+ grid . filter ( 'ProductName' , 'I' , IgxStringFilteringOperand . instance ( ) . condition ( 'startsWith' ) ) ;
2069
+ fix . detectChanges ( ) ;
2070
+
2071
+ GridFunctions . clickFilterCellChip ( fix , 'ProductName' ) ;
2072
+
2073
+ grid . filteringRow . onClearClick ( ) ;
2074
+ tick ( 100 ) ;
2075
+ fix . detectChanges ( ) ;
2076
+
2077
+ expect ( grid . filteringRow . expression . condition . name ) . toEqual ( 'startsWith' ) ;
2078
+ } ) ) ;
2079
+
2080
+ it ( 'should reset expression when the condition is unary' , fakeAsync ( ( ) => {
2081
+ GridFunctions . clickFilterCellChip ( fix , 'ProductName' ) ;
2082
+
2083
+ // iterate over unary conditions
2084
+ // empty
2085
+ GridFunctions . openFilterDDAndSelectCondition ( fix , 6 ) ;
2086
+
2087
+ grid . filteringRow . onClearClick ( ) ;
2088
+ tick ( 100 ) ;
2089
+ fix . detectChanges ( ) ;
2090
+
2091
+ expect ( grid . filteringRow . expression . condition . name ) . toEqual ( 'contains' ) ;
2092
+ } ) ) ;
2093
+
2067
2094
it ( 'Should filter by cells formatted data when using FormattedValuesFilteringStrategy' , fakeAsync ( ( ) => {
2068
2095
const formattedStrategy = new FormattedValuesFilteringStrategy ( [ 'Downloads' ] ) ;
2069
2096
grid . filterStrategy = formattedStrategy ;
@@ -6640,8 +6667,6 @@ const emitFilteringDoneOnInputClear = (fix, grid, filterVal, columnName, conditi
6640
6667
6641
6668
GridFunctions . clickFilterCellChip ( fix , columnName ) ;
6642
6669
6643
- // spyOn(grid.filteringDone, 'emit');
6644
-
6645
6670
grid . filteringRow . onClearClick ( ) ;
6646
6671
tick ( 100 ) ;
6647
6672
fix . detectChanges ( ) ;
0 commit comments