Skip to content

Commit

Permalink
test works
Browse files Browse the repository at this point in the history
  • Loading branch information
camueller committed Feb 10, 2019
1 parent 4676616 commit f678b62
Showing 1 changed file with 10 additions and 8 deletions.
Expand Up @@ -122,11 +122,11 @@ describe('StatusEvchargerEditComponent', () => {
const startButtonElement = fixture.debugElement.query(By.css('button[type=submit]')).nativeElement;
startButtonElement.click();
expect(statusService.requestEvCharge)
.toHaveBeenCalledWith(component.applianceId, component.status.evStatuses[0].id, undefined, socRequested, undefined);
.toHaveBeenCalledWith(component.applianceId, component.status.evStatuses[0].id, null, socRequested, undefined);
});
});

it('should submit the form with charge end', () => {
it('should submit the form with charge end', (done: any) => {
statusService.getSoc.and.returnValue(of(''));
statusService.requestEvCharge.and.returnValue( of(true));
fixture.autoDetectChanges();
Expand All @@ -139,13 +139,15 @@ describe('StatusEvchargerEditComponent', () => {
fixture.whenStable().then(() => {
FormUtil.selectOption(fixture, 'chargeEndDow', 'Thursday');
FormUtil.setInputValue(fixture, 'input[name=chargeEndTime]', chargeEndTime);
fixture.detectChanges();

// sui-select[formControlName='chargeEndDow']>div.text>span:nth-child(2)
const startButtonElement = fixture.debugElement.query(By.css('button[type=submit]')).nativeElement;
startButtonElement.click();
expect(statusService.requestEvCharge)
.toHaveBeenCalledWith(component.applianceId, component.status.evStatuses[0].id, undefined, undefined, chargeEnd);
fixture.whenStable().then(() => {
// sui-select[formControlName='chargeEndDow']>div.text>span:nth-child(2)
const startButtonElement = fixture.debugElement.query(By.css('button[type=submit]')).nativeElement;
startButtonElement.click();
expect(statusService.requestEvCharge)
.toHaveBeenCalledWith(component.applianceId, component.status.evStatuses[0].id, null, null, chargeEnd);
done();
});
});
});
});

0 comments on commit f678b62

Please sign in to comment.