Skip to content

Commit 26fff41

Browse files
committed
Attempting to fix test.
Attempting to fix test.
1 parent df19018 commit 26fff41

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

tests/unit/igcombo/combo.spec.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export function main() {
6666
}, 10);
6767
});
6868
});
69+
6970
it('should be updated correctly if the ngModel value is cleared.', (done) => {
7071
var template = '<div><ig-combo [(widgetId)]="comboID" [(options)]="options" [changeDetectionInterval]="cdi" [(ngModel)]="combo.value1"></ig-combo></div>';
7172
TestBed.overrideComponent(TestComponent, {
@@ -76,12 +77,16 @@ export function main() {
7677
TestBed.compileComponents().then(() => {
7778
let fixture = TestBed.createComponent(TestComponent);
7879
fixture.detectChanges();
79-
//clear
80-
$("#combo1").find(".ui-igcombo-clearicon").click();
81-
fixture.detectChanges();
80+
fixture.componentInstance.combo.value1 = 1;
81+
fixture.detectChanges();
8282
setTimeout(function () {
83-
expect(fixture.componentInstance.combo.value1 instanceof Array && fixture.componentInstance.combo.value1.length === 0).toBeTruthy();
84-
done();
83+
//clear
84+
$("#combo1").parents("ig-combo").find(".ui-igcombo-clearicon").click();
85+
fixture.detectChanges();
86+
setTimeout(function(){
87+
expect(fixture.componentInstance.combo.value1 instanceof Array && fixture.componentInstance.combo.value1.length === 0).toBeTruthy();
88+
done();
89+
}, 10);
8590
}, 10);
8691
});
8792
});

0 commit comments

Comments
 (0)