@@ -2064,6 +2064,33 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
20642064 expect ( grid . filteredData ) . toBeNull ( ) ;
20652065 } ) ) ;
20662066
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+
20672094 it ( 'Should filter by cells formatted data when using FormattedValuesFilteringStrategy' , fakeAsync ( ( ) => {
20682095 const formattedStrategy = new FormattedValuesFilteringStrategy ( [ 'Downloads' ] ) ;
20692096 grid . filterStrategy = formattedStrategy ;
@@ -6640,8 +6667,6 @@ const emitFilteringDoneOnInputClear = (fix, grid, filterVal, columnName, conditi
66406667
66416668 GridFunctions . clickFilterCellChip ( fix , columnName ) ;
66426669
6643- // spyOn(grid.filteringDone, 'emit');
6644-
66456670 grid . filteringRow . onClearClick ( ) ;
66466671 tick ( 100 ) ;
66476672 fix . detectChanges ( ) ;
0 commit comments