Skip to content

Commit 1b439af

Browse files
committed
test(igx-combo): fix tests #1260
1 parent e36bb9a commit 1b439af

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

projects/igniteui-angular/src/lib/combo/combo-dropdown.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,8 @@ export class IgxComboDropDownComponent extends IgxDropDownBase {
296296
* @hidden
297297
*/
298298
onToggleOpening() {
299+
this.toggleDirective.collapsed = false;
300+
this.cdr.detectChanges();
299301
this.parentElement.handleInputChange();
300302
this.onOpening.emit();
301303
}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,6 +1124,7 @@ describe('Combo', () => {
11241124
// Rendering
11251125
it('All appropriate classes should be applied on combo initialization', () => {
11261126
const defaultComboWidth = '250px';
1127+
const defaultComboDDWidth = '100%';
11271128
const fix = TestBed.createComponent(IgxComboScrollTestComponent);
11281129
fix.detectChanges();
11291130

@@ -1187,7 +1188,7 @@ describe('Combo', () => {
11871188

11881189
const dropDownWrapper = comboElement.children[1];
11891190
expect(dropDownWrapper.classList.contains(CSS_CLASS_COMBO_DROPDOWN)).toBeTruthy();
1190-
expect(dropDownWrapper.attributes.getNamedItem('ng-reflect-width').nodeValue).toEqual(defaultComboWidth);
1191+
expect(dropDownWrapper.attributes.getNamedItem('ng-reflect-width').nodeValue).toEqual(defaultComboDDWidth);
11911192
expect(dropDownWrapper.childElementCount).toEqual(1);
11921193

11931194
const dropDownElement = dropDownWrapper.children[0];
@@ -1197,7 +1198,7 @@ describe('Combo', () => {
11971198
const dropDownList = dropDownElement.children[0];
11981199
expect(dropDownList.classList.contains(CSS_CLASS_DROPDOWNLIST)).toBeTruthy();
11991200
expect(dropDownList.classList.contains('igx-toggle--hidden')).toBeTruthy();
1200-
expect(dropDownList.style.width).toEqual(defaultComboWidth);
1201+
expect(dropDownList.style.width).toEqual(defaultComboDDWidth);
12011202
expect(dropDownList.childElementCount).toEqual(0);
12021203
});
12031204
it('Should properly render grouped items', fakeAsync(() => {

0 commit comments

Comments
 (0)