@@ -4587,6 +4587,11 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
45874587 // Open excel style filtering dialog.
45884588 GridFunctions . clickExcelFilterIconFromCode ( fix , grid , 'Downloads' ) ;
45894589
4590+ let excelMenu = GridFunctions . getExcelStyleFilteringComponent ( fix ) ;
4591+
4592+ // Verify ESF is visible.
4593+ expect ( excelMenu ) . not . toBeNull ( ) ;
4594+
45904595 // Type string in search box.
45914596 const searchComponent = GridFunctions . getExcelStyleSearchComponent ( fix ) ;
45924597 const inputNativeElement = GridFunctions . getExcelStyleSearchComponentInput ( fix , searchComponent ) ;
@@ -4609,10 +4614,43 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
46094614 . sort ( ) ;
46104615
46114616 // Verify that excel style filtering dialog is closed and data is filtered.
4612- expect ( fix . debugElement . query ( By . css ( FILTER_UI_ROW ) ) ) . toBeNull ( ) ;
4617+ excelMenu = GridFunctions . getExcelStyleFilteringComponent ( fix ) ;
4618+ expect ( excelMenu ) . toBeNull ( ) ;
46134619 expect ( gridCellValues . length ) . toEqual ( 4 ) ;
46144620 expect ( gridCellValues ) . toEqual ( listItems ) ;
46154621 } ) ) ;
4622+
4623+ it ( 'Should clear input if there is text and \'Escape\' is pressed.' , fakeAsync ( ( ) => {
4624+ // Open excel style filtering dialog.
4625+ GridFunctions . clickExcelFilterIconFromCode ( fix , grid , 'Downloads' ) ;
4626+
4627+ let inputNativeElement = GridFunctions . getExcelStyleSearchComponentInput ( fix ) ;
4628+ let excelMenu = GridFunctions . getExcelStyleFilteringComponent ( fix ) ;
4629+
4630+ // Verify ESF is visible.
4631+ expect ( excelMenu ) . not . toBeNull ( ) ;
4632+
4633+ // Verify that the dialog is closed on pressing Escape.
4634+ inputNativeElement . dispatchEvent ( new KeyboardEvent ( 'keydown' , { key : 'Escape' , bubbles : true } ) ) ;
4635+ excelMenu = GridFunctions . getExcelStyleFilteringComponent ( fix ) ;
4636+ expect ( excelMenu ) . toBeNull ( ) ;
4637+
4638+ // Open excel style filtering dialog again and type in the input.
4639+ GridFunctions . clickExcelFilterIconFromCode ( fix , grid , 'Downloads' ) ;
4640+ inputNativeElement = GridFunctions . getExcelStyleSearchComponentInput ( fix ) ;
4641+
4642+ UIInteractions . clickAndSendInputElementValue ( inputNativeElement , '2' , fix ) ;
4643+
4644+ // Press Escape again and verify that ESF menu is still visible and the input is empty
4645+ inputNativeElement . dispatchEvent ( new KeyboardEvent ( 'keydown' , { key : 'Escape' , bubbles : true } ) ) ;
4646+ inputNativeElement = GridFunctions . getExcelStyleSearchComponentInput ( fix ) ;
4647+ fix . detectChanges ( ) ;
4648+ flush ( ) ;
4649+
4650+ excelMenu = GridFunctions . getExcelStyleFilteringComponent ( fix ) ;
4651+ expect ( excelMenu ) . not . toBeNull ( ) ;
4652+ expect ( inputNativeElement . value ) . toBe ( '' , 'input isn\'t cleared correctly' ) ;
4653+ } ) ) ;
46164654} ) ;
46174655
46184656 describe ( 'Templates: ' , ( ) => {
0 commit comments