@@ -380,6 +380,52 @@ describe('IgxGrid - Advanced Filtering', () => {
380380 . toBe ( false , 'Button icon indicates there is active filtering.' ) ;
381381 } ) ) ;
382382
383+ it ( 'Should correctly display header name in select dropdown and in chip expression.' , fakeAsync ( ( ) => {
384+ // Open Advanced Filtering dialog.
385+ GridFunctions . clickAdvancedFilteringButton ( fix ) ;
386+ fix . detectChanges ( ) ;
387+
388+ // Click the initial 'Add And Group' button.
389+ const addAndGroupButton = GridFunctions . getAdvancedFilteringInitialAddGroupButtons ( fix ) [ 0 ] ;
390+ addAndGroupButton . click ( ) ;
391+ tick ( 100 ) ;
392+ fix . detectChanges ( ) ;
393+
394+ // Open column dropdown and verify header name is displayed for first item
395+ GridFunctions . clickAdvancedFilteringColumnSelect ( fix ) ;
396+ fix . detectChanges ( ) ;
397+ const dropdownItems = GridFunctions . getAdvancedFilteringSelectDropdownItems ( fix ) ;
398+ expect ( dropdownItems [ 0 ] . innerText ) . toBe ( 'HeaderID' ) ;
399+
400+ selectColumnInEditModeExpression ( fix , 0 ) ; // Select 'HeaderID' column
401+ selectOperatorInEditModeExpression ( fix , 0 ) ; // Select 'Contains' operator.
402+ const input = GridFunctions . getAdvancedFilteringValueInput ( fix ) . querySelector ( 'input' ) ;
403+ sendInputNativeElement ( fix , input , 'a' ) ; // Type filter value.
404+
405+ // Commit the populated expression.
406+ GridFunctions . clickAdvancedFilteringExpressionCommitButton ( fix ) ;
407+ fix . detectChanges ( ) ;
408+
409+ // Verify header name in chip text
410+ verifyExpressionChipContent ( fix , [ 0 ] , 'HeaderID' , 'Contains' , 'a' ) ;
411+
412+ // Apply the filters.
413+ GridFunctions . clickAdvancedFilteringApplyButton ( fix ) ;
414+ fix . detectChanges ( ) ;
415+
416+ // Close Advanced Filtering dialog.
417+ GridFunctions . clickAdvancedFilteringCancelButton ( fix ) ;
418+ tick ( 100 ) ;
419+ fix . detectChanges ( ) ;
420+
421+ // Open Advanced Filtering dialog again.
422+ GridFunctions . clickAdvancedFilteringButton ( fix ) ;
423+ fix . detectChanges ( ) ;
424+
425+ // Verify header name in chip text
426+ verifyExpressionChipContent ( fix , [ 0 ] , 'HeaderID' , 'Contains' , 'a' ) ;
427+ } ) ) ;
428+
383429 it ( 'Should correctly filter by a \'string\' column through UI.' , fakeAsync ( ( ) => {
384430 // Test prerequisites
385431 grid . height = '800px' ;
@@ -894,7 +940,7 @@ describe('IgxGrid - Advanced Filtering', () => {
894940 fix . detectChanges ( ) ;
895941 const dropdownItems = GridFunctions . getAdvancedFilteringSelectDropdownItems ( fix ) ;
896942 expect ( dropdownItems . length ) . toBe ( 3 ) ;
897- expect ( dropdownItems [ 0 ] . innerText ) . toBe ( 'ID ' ) ;
943+ expect ( dropdownItems [ 0 ] . innerText ) . toBe ( 'HeaderID ' ) ;
898944 expect ( dropdownItems [ 1 ] . innerText ) . toBe ( 'ProductName' ) ;
899945 expect ( dropdownItems [ 2 ] . innerText ) . toBe ( 'Another Field' ) ;
900946 } ) ) ;
0 commit comments