GNM-1131 FE Unit Tests
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 070ee77..317a424 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -161,6 +161,7 @@
AuthGuard,
ModifyGridConfigService
],
+ exports: [ToasterComponent],
bootstrap: [AppComponent]
})
export class AppModule { }
diff --git a/src/app/lists/status-changes/status-changes.component.ts b/src/app/lists/status-changes/status-changes.component.ts
index 4bca473..66bef19 100644
--- a/src/app/lists/status-changes/status-changes.component.ts
+++ b/src/app/lists/status-changes/status-changes.component.ts
@@ -45,7 +45,6 @@
this.showSpinner = false;
}, error => {
console.log(error);
- // this.messageService.emitError(this.gridId, ErrorType.retrieve, error);
this.toasterMessageService.showError(ErrorType.retrieve, this.gridId, error);
});
} else {
diff --git a/src/app/pages/single-grid-measure-detail-tab/single-grid-measure-detail-tab.component.html b/src/app/pages/single-grid-measure-detail-tab/single-grid-measure-detail-tab.component.html
index a0f9bd8..1fa3626 100644
--- a/src/app/pages/single-grid-measure-detail-tab/single-grid-measure-detail-tab.component.html
+++ b/src/app/pages/single-grid-measure-detail-tab/single-grid-measure-detail-tab.component.html
@@ -12,9 +12,6 @@
<div #singleGridMeasureDetailFormCotainer>
<form #singleGridForm="ngForm" (change)="onSingleGridFormValidation(singleGridForm.form.valid)">
<fieldset class="form-group" disabled="{{ readOnlyForm ? 'disabled' : ''}}">
- <h4>
- <b>{{gridMeasureDetail?.title}} </b>
- </h4>
<div class="row actions">
<div class="col-lg-12">
<button class="btn btn-primary pull-right" id="createInvertedStep" (click)="duplicateSingleGM()" [disabled]="isSingleGridmeasureLimitReached()">Rückschaltung
diff --git a/src/app/pages/step/step.component.spec.ts b/src/app/pages/step/step.component.spec.ts
index 4c0c95a..0580e7e 100644
--- a/src/app/pages/step/step.component.spec.ts
+++ b/src/app/pages/step/step.component.spec.ts
@@ -291,12 +291,17 @@
expect(component.handleNextLevel).toHaveBeenCalled();
});
- xit('should prepareTreeModel and show the tree', () => {
- spyOn(component, 'prepareTreeModel').and.callThrough();
+ xit('should prepareTreeModel and show the tree', async(() => {
+ spyOn(component, 'prepareTreeModel').and.returnValue(Promise.resolve);
const resources = JSON.parse(JSON.stringify(POWERSYSTEMRESOURCES));
- component.prepareTreeModel(resources, 1);
fixture.detectChanges();
- expect(component.isTreeAvailable).toBeTruthy();
- });
+ component.prepareTreeModel(resources, 1);
+
+ fixture.whenStable().then(() => {
+ fixture.detectChanges();
+ expect(component.isTreeAvailable).toBeTruthy();
+ });
+
+ }));
});
diff --git a/src/app/pages/step/step.component.ts b/src/app/pages/step/step.component.ts
index 3fd7afe..59173ae 100644
--- a/src/app/pages/step/step.component.ts
+++ b/src/app/pages/step/step.component.ts
@@ -168,7 +168,6 @@
this.processRessourceTypesResponse(res);
},
error => {
- // this.messageService.emitError('CimCache', ErrorType.retrieve);
this.toasterMessageService.showError(ErrorType.retrieve, 'CimCache');
console.log(error);
});
@@ -178,7 +177,6 @@
const newTreeModel: TreeModel = new TreeModelImpl();
const xmlStringRes = await this.cimCacheService.getRessourcesWithType(value).toPromise().catch(error => {
- // this.messageService.emitError('CimCache', ErrorType.retrieve);
this.toasterMessageService.showError(ErrorType.retrieve, 'CimCache');
});
@@ -256,7 +254,6 @@
// ...deswegen Fake Childs atm fest auf 'ac-line-segment'
const xmlStringRes = await this.cimCacheService.getRessourcesWithType('ac-line-segment').toPromise().catch(error => {
- // this.messageService.emitError('CimCache', ErrorType.retrieve);
this.toasterMessageService.showError(ErrorType.retrieve, 'CimCache');
});