summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.spec.ts
diff options
context:
space:
mode:
authorEylon Malin <eylon.malin@intl.att.com>2019-12-05 08:44:29 +0200
committerEylon Malin <eylon.malin@intl.att.com>2019-12-05 08:44:29 +0200
commitbfc61c4bb476d05ed0e06ecc9e68121e364cfceb (patch)
treee26869bee96c431158082953c2314b39ce95a70c /vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.spec.ts
parent7cdf685b0b8726e9ee2233d189692dbeb7e434f5 (diff)
support recreate and isRecreateEnabled in instantiationStatus service
Issue-ID: VID-724 Signed-off-by: Eylon Malin <eylon.malin@intl.att.com> Change-Id: Iae797bfa49d73059d67e66b5a6dc0ea62de1195c
Diffstat (limited to 'vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.spec.ts')
-rw-r--r--vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.spec.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.spec.ts b/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.spec.ts
index a5e6fab89..29adfa9e0 100644
--- a/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.spec.ts
+++ b/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.spec.ts
@@ -10,6 +10,8 @@ import {DrawingBoardModes} from "../drawingBoard/service-planning/drawing-board.
import {RouterTestingModule} from "@angular/router/testing";
import {of} from "rxjs";
import {UrlTree} from "@angular/router";
+import each from "jest-each";
+import {ServiceAction} from "../shared/models/serviceInstanceActions";
class MockAppStore<T> {
@@ -158,6 +160,18 @@ describe('Instantiation Status Service', () => {
expect(statusResult.iconClassName).toEqual(UNKNOWN);
});
+
+ each([
+ [true, ServiceAction.INSTANTIATE],
+ [false, ServiceAction.UPDATE],
+ [false, ServiceAction.DELETE],
+ ]).
+ test('isRecreateEnabled: should be %s if action is %s', (expected:boolean, action:ServiceAction) => {
+ let serviceInfoModel = new ServiceInfoModel();
+ serviceInfoModel.action = action;
+ expect(service.isRecreateEnabled(serviceInfoModel)).toBe(expected);
+ });
+
test('getStatusTooltip should return correct icon per job status', () => {
let result : ServiceStatus = service.getStatus('pending');
expect(result.iconClassName).toEqual(PENDING);