Skip to content

Commit b9a35d9

Browse files
committed
test(igx-grid): Add test, #2979
1 parent fb8661e commit b9a35d9

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2452,6 +2452,27 @@ describe('IgxGrid - Filtering Row UI actions', () => {
24522452
expect(colOperands[0].nativeElement.innerText).toEqual('AND');
24532453
expect(colIndicator.length).toEqual(0);
24542454
}));
2455+
2456+
it('Should close FilterRow when Escape is pressed.', fakeAsync(() => {
2457+
const fix = TestBed.createComponent(IgxGridFilteringComponent);
2458+
fix.detectChanges();
2459+
2460+
const initialChips = fix.debugElement.queryAll(By.directive(IgxChipComponent));
2461+
const stringCellChip = initialChips[0].nativeElement;
2462+
2463+
stringCellChip.click();
2464+
fix.detectChanges();
2465+
2466+
let filteringRow = fix.debugElement.query(By.directive(IgxGridFilteringRowComponent));
2467+
expect(filteringRow).toBeDefined();
2468+
2469+
GridFunctions.simulateKeyboardEvent(filteringRow, 'keydown', 'Esc');
2470+
fix.detectChanges();
2471+
2472+
filteringRow = fix.debugElement.query(By.directive(IgxGridFilteringRowComponent));
2473+
2474+
expect(filteringRow).toBeNull();
2475+
}));
24552476
});
24562477

24572478
export class CustomFilter extends IgxFilteringOperand {

0 commit comments

Comments
 (0)