@@ -4213,6 +4213,7 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
42134213
42144214 it ( 'Should correctly update all items based on \'SelectAll\' checkbox.' , fakeAsync ( ( ) => {
42154215 GridFunctions . clickExcelFilterIconFromCode ( fix , grid , 'ProductName' ) ;
4216+ flush ( ) ;
42164217
42174218 const visibleListItems = GridFunctions . getExcelStyleFilteringCheckboxes ( fix ) ;
42184219 const dataListItems = visibleListItems . slice ( 1 , visibleListItems . length ) ;
@@ -4245,6 +4246,7 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
42454246
42464247 it ( 'Should correctly update all \'SelectAll\' checkbox when not a single item is checked.' , fakeAsync ( ( ) => {
42474248 GridFunctions . clickExcelFilterIconFromCode ( fix , grid , 'Released' ) ;
4249+ flush ( ) ;
42484250
42494251 const visibleListItems = GridFunctions . getExcelStyleFilteringCheckboxes ( fix ) ;
42504252 expect ( visibleListItems . length ) . toBe ( 4 ) ;
@@ -4377,6 +4379,48 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
43774379 expect ( listItems [ 3 ] . innerText ) . toBe ( 'custoM' , 'incorrect list item label' ) ;
43784380 expect ( listItems [ 4 ] . innerText ) . toBe ( 'custom' , 'incorrect list item label' ) ;
43794381 } ) ) ;
4382+
4383+ it ( 'Should clear search criteria when selecting clear column filters option.' , fakeAsync ( ( ) => {
4384+ GridFunctions . clickExcelFilterIconFromCode ( fix , grid , 'ProductName' ) ;
4385+
4386+ let checkboxes = GridFunctions . getExcelStyleFilteringCheckboxes ( fix ) ;
4387+ fix . detectChanges ( ) ;
4388+
4389+ checkboxes [ 0 ] . click ( ) ;
4390+ tick ( ) ;
4391+ fix . detectChanges ( ) ;
4392+
4393+ checkboxes [ 2 ] . click ( ) ;
4394+ tick ( ) ;
4395+ fix . detectChanges ( ) ;
4396+
4397+ GridFunctions . clickApplyExcelStyleFiltering ( fix ) ;
4398+ tick ( ) ;
4399+ fix . detectChanges ( ) ;
4400+ expect ( grid . filteredData . length ) . toEqual ( 1 ) ;
4401+
4402+ GridFunctions . clickExcelFilterIconFromCode ( fix , grid , 'ProductName' ) ;
4403+ flush ( ) ;
4404+
4405+ let inputNativeElement = GridFunctions . getExcelStyleSearchComponentInput ( fix ) ;
4406+ UIInteractions . clickAndSendInputElementValue ( inputNativeElement , 'Net' , fix ) ;
4407+
4408+ const listItems = GridFunctions . getExcelStyleSearchComponentListItems ( fix ) ;
4409+ expect ( listItems . length ) . toBe ( 2 , 'incorrect rendered list items count' ) ;
4410+
4411+ GridFunctions . clickClearFilterInExcelStyleFiltering ( fix ) ;
4412+ flush ( ) ;
4413+ expect ( grid . filteredData ) . toBeNull ( ) ;
4414+
4415+ inputNativeElement = GridFunctions . getExcelStyleSearchComponentInput ( fix ) ;
4416+ expect ( inputNativeElement . value ) . toBe ( '' , 'search criteria is not cleared' ) ;
4417+
4418+ checkboxes = GridFunctions . getExcelStyleFilteringCheckboxes ( fix ) ;
4419+ const listItemsCheckboxes = checkboxes . slice ( 1 , checkboxes . length ) ;
4420+ for ( const checkbox of listItemsCheckboxes ) {
4421+ ControlsFunction . verifyCheckboxState ( checkbox . parentElement ) ;
4422+ }
4423+ } ) ) ;
43804424 } ) ;
43814425
43824426 describe ( 'Templates: ' , ( ) => {
@@ -4527,6 +4571,23 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
45274571 GridSelectionFunctions . verifyColumnAndCellsSelected ( columnId , false ) ;
45284572
45294573 } ) ;
4574+
4575+ it ( 'Should reset esf menu with templates on column change' , fakeAsync ( ( ) => {
4576+ GridFunctions . clickExcelFilterIconFromCode ( fix , grid , 'Downloads' ) ;
4577+ flush ( ) ;
4578+
4579+ let inputNativeElement = GridFunctions . getExcelStyleSearchComponentInput ( fix ) ;
4580+ UIInteractions . clickAndSendInputElementValue ( inputNativeElement , 20 , fix ) ;
4581+
4582+ const listItems = GridFunctions . getExcelStyleSearchComponentListItems ( fix ) ;
4583+ expect ( listItems . length ) . toBe ( 2 , 'incorrect rendered list items count' ) ;
4584+
4585+ GridFunctions . clickExcelFilterIconFromCode ( fix , grid , 'ProductName' ) ;
4586+ flush ( ) ;
4587+
4588+ inputNativeElement = GridFunctions . getExcelStyleSearchComponentInput ( fix ) ;
4589+ expect ( inputNativeElement . value ) . toBe ( '' , 'input value didn\'t reset' ) ;
4590+ } ) ) ;
45304591 } ) ;
45314592
45324593 describe ( 'Load values on demand' , ( ) => {
@@ -4740,7 +4801,6 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
47404801 GridSelectionFunctions . verifyColumnAndCellsSelected ( columnId , false ) ;
47414802
47424803 } ) ;
4743-
47444804 } ) ;
47454805} ) ;
47464806
0 commit comments