Skip to content

Commit f9767a7

Browse files
committed
test(filtering): Adding test #9333
# Conflicts: # projects/igniteui-angular/src/lib/grids/grid/grid-filtering-ui.spec.ts # Conflicts: # projects/igniteui-angular/src/lib/grids/grid/grid-filtering-ui.spec.ts
1 parent fd05909 commit f9767a7

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

projects/igniteui-angular/src/lib/grids/grid/grid-filtering-ui.spec.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import {
4747
import { GridSelectionMode, FilterMode } from '../common/enums';
4848
import { ControlsFunction } from '../../test-utils/controls-functions.spec';
4949
import localeFR from '@angular/common/locales/fr';
50+
import { IgxInputGroupComponent } from '../../input-group/public_api';
5051

5152
const DEBOUNCETIME = 30;
5253
const 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

Comments
 (0)