@@ -147,6 +147,10 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
147147 tick ( ) ;
148148 fix . detectChanges ( ) ;
149149
150+ let operands =
151+ ( grid . filteringExpressionsTree . filteringOperands [ 0 ] as IFilteringExpressionsTree )
152+ . filteringOperands as IFilteringExpression [ ] ;
153+ verifyFilteringExpression ( operands [ 0 ] , 'ProductName' , 'startsWith' , 'Net' ) ;
150154 verifyFilterUIPosition ( filterUIRow , grid ) ;
151155 verifyFilterRowUI ( input , close , reset , false ) ;
152156 expect ( grid . rowList . length ) . toEqual ( 1 ) ;
@@ -156,6 +160,10 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
156160 GridFunctions . openFilterDDAndSelectCondition ( fix , 3 ) ;
157161 GridFunctions . typeValueInFilterRowInput ( 'script' , fix , input ) ;
158162
163+ operands =
164+ ( grid . filteringExpressionsTree . filteringOperands [ 0 ] as IFilteringExpressionsTree )
165+ . filteringOperands as IFilteringExpression [ ] ;
166+ verifyFilteringExpression ( operands [ 0 ] , 'ProductName' , 'endsWith' , 'script' ) ;
159167 expect ( grid . rowList . length ) . toEqual ( 2 ) ;
160168 verifyFilterRowUI ( input , close , reset , false ) ;
161169
@@ -3831,6 +3839,33 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
38313839 expect ( grid . filteredData . length ) . toEqual ( 1 ) ;
38323840 } ) ) ;
38333841
3842+ it ( 'Should keep conditionName in sync when changing condition in ESF custom dialog.' , fakeAsync ( ( ) => {
3843+ GridFunctions . clickExcelFilterIconFromCode ( fix , grid , 'ProductName' ) ;
3844+
3845+ GridFunctions . clickExcelFilterCascadeButton ( fix ) ;
3846+ tick ( ) ;
3847+ fix . detectChanges ( ) ;
3848+
3849+ // Open custom dialog with 'contains' condition (index 0 in cascade menu for string column)
3850+ GridFunctions . clickOperatorFromCascadeMenu ( fix , 0 ) ;
3851+ tick ( 100 ) ;
3852+
3853+ // set first expression's value
3854+ GridFunctions . setInputValueESF ( fix , 0 , 'Net' ) ;
3855+ tick ( 100 ) ;
3856+
3857+ // change first expression's operator from 'contains' to 'startsWith' (index 2 for string column)
3858+ GridFunctions . setOperatorESF ( fix , 0 , 2 ) ;
3859+ tick ( 100 ) ;
3860+
3861+ GridFunctions . clickApplyExcelStyleCustomFiltering ( fix ) ;
3862+
3863+ const operands =
3864+ ( grid . filteringExpressionsTree . filteringOperands [ 0 ] as IFilteringExpressionsTree )
3865+ . filteringOperands as IFilteringExpression [ ] ;
3866+ verifyFilteringExpression ( operands [ 0 ] , 'ProductName' , 'startsWith' , 'Net' ) ;
3867+ } ) ) ;
3868+
38343869 it ( 'Should filter grid via custom dialog - 3 expressions.' , fakeAsync ( ( ) => {
38353870 GridFunctions . clickExcelFilterIconFromCode ( fix , grid , 'Released' ) ;
38363871
@@ -7519,6 +7554,7 @@ const verifyGridSubmenuSize = (gridNativeElement: HTMLElement, expectedSize: Siz
75197554const verifyFilteringExpression = ( operand : IFilteringExpression , fieldName : string , conditionName : string , searchVal : any ) => {
75207555 expect ( operand . fieldName ) . toBe ( fieldName ) ;
75217556 expect ( operand . condition . name ) . toBe ( conditionName ) ;
7557+ expect ( operand . conditionName ) . toBe ( conditionName ) ;
75227558 expect ( operand . searchVal ) . toEqual ( searchVal ) ;
75237559} ;
75247560
0 commit comments