Skip to content

Commit ee3cde5

Browse files
committed
test(simple-combo): Moving the into the correct describe
1 parent 3e4298f commit ee3cde5

File tree

1 file changed

+30
-31
lines changed

1 file changed

+30
-31
lines changed

projects/igniteui-angular/src/lib/simple-combo/simple-combo.component.spec.ts

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const CSS_CLASS_INPUT_GROUP_INVALID = 'igx-input-group--invalid';
4545
const defaultDropdownItemHeight = 40;
4646
const defaultDropdownItemMaxHeight = 400;
4747

48-
describe('IgxSimpleCombo', () => {
48+
fdescribe('IgxSimpleCombo', () => {
4949
let fixture: ComponentFixture<any>;
5050
let combo: IgxSimpleComboComponent;
5151
let input: DebugElement;
@@ -2065,45 +2065,44 @@ describe('IgxSimpleCombo', () => {
20652065
expect((combo as any).inputGroup.element.nativeElement.classList.contains(CSS_CLASS_INPUT_GROUP_INVALID)).toBe(true);
20662066
expect((combo as any).inputGroup.element.nativeElement.classList.contains(CSS_CLASS_INPUT_GROUP_REQUIRED)).toBe(false);
20672067
}));
2068-
});
2069-
2070-
it('Should update the model only if a selection is changing otherwise it should be undefiend when the user is filtering in reactive form', fakeAsync(() => {
2071-
const form = (fixture.componentInstance as IgxSimpleComboInReactiveFormComponent).comboForm;
2072-
input = fixture.debugElement.query(By.css(`.${CSS_CLASS_COMBO_INPUTGROUP}`));
20732068

2074-
combo.open();
2075-
fixture.detectChanges();
2069+
it('Should update the model only if a selection is changing otherwise it should be undefiend when the user is filtering in reactive form', fakeAsync(() => {
2070+
const form = (fixture.componentInstance as IgxSimpleComboInReactiveFormComponent).comboForm;
2071+
input = fixture.debugElement.query(By.css(`.${CSS_CLASS_COMBO_INPUTGROUP}`));
20762072

2077-
const item2 = fixture.debugElement.queryAll(By.css(`.${CSS_CLASS_DROPDOWNLISTITEM}`))[3];
2078-
item2.triggerEventHandler('click', UIInteractions.getMouseEvent('click'));
2079-
fixture.detectChanges();
2073+
combo.open();
2074+
fixture.detectChanges();
20802075

2076+
const item2 = fixture.debugElement.queryAll(By.css(`.${CSS_CLASS_DROPDOWNLISTITEM}`))[3];
2077+
item2.triggerEventHandler('click', UIInteractions.getMouseEvent('click'));
2078+
fixture.detectChanges();
20812079

2082-
expect(combo.displayValue).toEqual(['Four']);
2083-
expect(combo.value).toEqual([4]);
2084-
expect(form.controls['comboValue'].value).toEqual([4]);
20852080

2086-
combo.deselect();
2087-
fixture.detectChanges();
2081+
expect(combo.displayValue).toEqual(['Four']);
2082+
expect(combo.value).toEqual([4]);
2083+
expect(form.controls['comboValue'].value).toEqual(4);
20882084

2089-
expect(combo.selection).toEqual([]);
2090-
expect(form.controls['comboValue'].value).toEqual(undefined);
2091-
expect(combo.displayValue).toEqual([]);
2085+
combo.deselect();
2086+
fixture.detectChanges();
20922087

2093-
combo.focusSearchInput();
2094-
UIInteractions.simulateTyping('on', input);
2095-
fixture.detectChanges();
2096-
expect(combo.comboInput.value).toEqual('on');
2097-
expect(form.controls['comboValue'].value).toEqual(undefined);
2088+
expect(combo.selection).toEqual([]);
2089+
expect(form.controls['comboValue'].value).toEqual(undefined);
2090+
expect(combo.displayValue).toEqual([]);
20982091

2099-
combo.select(combo.data[0][combo.valueKey]);
2100-
fixture.detectChanges();
2101-
expect(combo.selection).toBeDefined();
2102-
expect(combo.displayValue).toEqual(['One']);
2103-
expect(combo.value).toEqual([1]);
2104-
expect(form.controls['comboValue'].value).toEqual(1);
2105-
}));
2092+
combo.focusSearchInput();
2093+
UIInteractions.simulateTyping('on', input);
2094+
fixture.detectChanges();
2095+
expect(combo.comboInput.value).toEqual('on');
2096+
expect(form.controls['comboValue'].value).toEqual(undefined);
21062097

2098+
combo.select(combo.data[0][combo.valueKey]);
2099+
fixture.detectChanges();
2100+
expect(combo.selection).toBeDefined();
2101+
expect(combo.displayValue).toEqual(['One']);
2102+
expect(combo.value).toEqual([1]);
2103+
expect(form.controls['comboValue'].value).toEqual(1);
2104+
}));
2105+
});
21072106
});
21082107

21092108
describe('Selection tests: ', () => {

0 commit comments

Comments
 (0)