Skip to content

Commit f28ab55

Browse files
committed
test(filtering): Adding a test for fix #5627
1 parent 79b07c3 commit f28ab55

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

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

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3355,8 +3355,33 @@ describe('IgxGrid - Filtering Row UI actions', () => {
33553355
expect(fix.debugElement.query(By.css(FILTER_UI_ROW))).toBeNull();
33563356
GridFunctions.verifyColumnIsHidden(prodNameCol, true , 5);
33573357
}));
3358-
});
33593358

3359+
it('Unary conditions should be committable', fakeAsync (() => {
3360+
grid.height = '700px';
3361+
fix.detectChanges();
3362+
3363+
const prodNameCol = grid.columns.find((col) => col.field === 'ProductName');
3364+
GridFunctions.clickFilterCellChip(fix, 'ProductName');
3365+
fix.detectChanges();
3366+
3367+
// Check that the filterRow is opened
3368+
const filterUIRow = fix.debugElement.query(By.css(FILTER_UI_ROW));
3369+
GridFunctions.openFilterDD(fix.debugElement);
3370+
const dropdownList = fix.debugElement.query(By.css('div.igx-drop-down__list.igx-toggle'));
3371+
GridFunctions.selectFilteringCondition('Empty', dropdownList);
3372+
fix.detectChanges();
3373+
tick(16);
3374+
3375+
const chip = filterUIRow.query(By.directive(IgxChipComponent));
3376+
const input = filterUIRow.query(By.directive(IgxInputDirective));
3377+
expect(chip.componentInstance.selected).toBeTruthy();
3378+
3379+
clickElemAndBlur(chip, input);
3380+
fix.detectChanges();
3381+
tick(100);
3382+
expect(chip.componentInstance.selected).toBeFalsy();
3383+
}));
3384+
});
33603385
describe(null, () => {
33613386
let fix, grid;
33623387
beforeEach(fakeAsync(() => {
@@ -6262,8 +6287,8 @@ function clickElemAndBlur(clickElem, blurElem) {
62626287
const elementRect = clickElem.nativeElement.getBoundingClientRect();
62636288
UIInteractions.simulatePointerEvent('pointerdown', clickElem.nativeElement, elementRect.left, elementRect.top);
62646289
blurElem.nativeElement.blur();
6265-
blurElem.nativeElement.dispatchEvent(new FocusEvent('focusout', {bubbles: true}));
62666290
(clickElem as DebugElement).nativeElement.focus();
6291+
blurElem.nativeElement.dispatchEvent(new FocusEvent('focusout', {bubbles: true}));
62676292
UIInteractions.simulatePointerEvent('pointerup', clickElem.nativeElement, elementRect.left, elementRect.top);
62686293
UIInteractions.simulateMouseEvent('click', clickElem.nativeElement, 10 , 10);
62696294
}

0 commit comments

Comments
 (0)