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