@@ -3421,6 +3421,34 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
3421
3421
tick ( 100 ) ;
3422
3422
expect ( chip . componentInstance . selected ) . toBeTruthy ( ) ;
3423
3423
} ) ) ;
3424
+
3425
+ it ( 'Should close filterRow when changing filterMode from \'quickFilter\' to \'excelStyleFilter\'' , ( async ( ) => {
3426
+ GridFunctions . clickFilterCellChip ( fix , 'ProductName' ) ;
3427
+ fix . detectChanges ( ) ;
3428
+
3429
+ // Add a condition chip without submitting it.
3430
+ GridFunctions . typeValueInFilterRowInput ( 'a' , fix ) ;
3431
+ await wait ( 16 ) ;
3432
+
3433
+ // Change filterMode to 'excelStyleFilter`
3434
+ grid . filterMode = FilterMode . excelStyleFilter ;
3435
+ fix . detectChanges ( ) ;
3436
+
3437
+ // Verify the the filterRow is closed.
3438
+ const filterUIRow = fix . debugElement . query ( By . css ( FILTER_UI_ROW ) ) ;
3439
+ expect ( filterUIRow ) . toBeNull ( 'filterRow is visible' ) ;
3440
+
3441
+ // Verify the ESF icons are visible.
3442
+ const gridNativeElement = fix . debugElement . query ( By . css ( 'igx-grid' ) ) . nativeElement ;
3443
+ const thead = gridNativeElement . querySelector ( '.igx-grid__thead-wrapper' ) ;
3444
+ const filterIcons = thead . querySelectorAll ( '.igx-excel-filter__icon' ) ;
3445
+ expect ( filterIcons . length ) . toEqual ( 4 , 'incorrect esf filter icons count' ) ;
3446
+
3447
+ // Verify the condition was submitted.
3448
+ const header = GridFunctions . getColumnHeader ( 'ProductName' , fix ) ;
3449
+ const activeFilterIcon = header . nativeElement . querySelector ( '.igx-excel-filter__icon--filtered' ) ;
3450
+ expect ( activeFilterIcon ) . toBeDefined ( 'no active filter icon was found' ) ;
3451
+ } ) ) ;
3424
3452
} ) ;
3425
3453
describe ( null , ( ) => {
3426
3454
let fix , grid ;
@@ -3629,6 +3657,7 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
3629
3657
let fix , grid ;
3630
3658
beforeEach ( fakeAsync ( ( ) => {
3631
3659
fix = TestBed . createComponent ( IgxGridFilteringComponent ) ;
3660
+ fix . detectChanges ( ) ;
3632
3661
grid = fix . componentInstance . grid ;
3633
3662
grid . filterMode = FilterMode . excelStyleFilter ;
3634
3663
fix . detectChanges ( ) ;
0 commit comments