@@ -47,6 +47,7 @@ import {
4747import { GridSelectionMode , FilterMode } from '../common/enums' ;
4848import { ControlsFunction } from '../../test-utils/controls-functions.spec' ;
4949import localeFR from '@angular/common/locales/fr' ;
50+ import { IgxInputGroupComponent } from '../../input-group/public_api' ;
5051
5152const DEBOUNCETIME = 30 ;
5253const FILTER_UI_ROW = 'igx-grid-filtering-row' ;
@@ -2116,6 +2117,28 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
21162117 // Verify filtered data
21172118 expect ( grid . filteredData ) . toBeNull ( ) ;
21182119 } ) ) ;
2120+
2121+ it ( 'Should remove pending chip via its close button #9333' , fakeAsync ( ( ) => {
2122+ GridFunctions . clickFilterCellChipUI ( fix , 'Downloads' ) ;
2123+ fix . detectChanges ( ) ;
2124+
2125+ GridFunctions . typeValueInFilterRowInput ( '3' , fix ) ;
2126+ tick ( DEBOUNCETIME ) ;
2127+ const inputGroup = fix . debugElement . query ( By . directive ( IgxInputGroupComponent ) ) ;
2128+ const filterRow = fix . debugElement . query ( By . directive ( IgxGridFilteringRowComponent ) ) ;
2129+ const pendingChip = filterRow . queryAll ( By . directive ( IgxChipComponent ) ) [ 0 ] ;
2130+ const chipCloseButton = pendingChip . query ( By . css ( 'div.igx-chip__remove' ) ) . nativeElement ;
2131+
2132+ chipCloseButton . dispatchEvent ( new Event ( 'mousedown' ) ) ;
2133+ inputGroup . nativeElement . dispatchEvent ( new Event ( 'focusout' ) ) ;
2134+ chipCloseButton . dispatchEvent ( new Event ( 'mouseup' ) ) ;
2135+ chipCloseButton . dispatchEvent ( new Event ( 'click' ) ) ;
2136+ tick ( DEBOUNCETIME ) ;
2137+ fix . detectChanges ( ) ;
2138+
2139+ const chips = filterRow . queryAll ( By . directive ( IgxChipComponent ) ) ;
2140+ expect ( chips . length ) . toEqual ( 0 , 'No chips should be present' ) ;
2141+ } ) ) ;
21192142 } ) ;
21202143
21212144 describe ( 'Integration scenarios' , ( ) => {
0 commit comments