aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2019-10-30 14:46:22 +0200
committerIttay Stern <ittay.stern@att.com>2019-10-30 14:46:22 +0200
commitc439c8193a2f819586b0ca9bb1b219a5c110e092 (patch)
treee59f45a42b5132f3e9e564f9213addf14f0408c5
parenta8ebb74702f07acead84edcdaf083d78a84d00a3 (diff)
Instantiation-Status: default on unexpected/undefined statuses (fix)
Issue-ID: VID-692 Change-Id: I15c81daba1a45ff0e009d5e381f93adb03914c0f Signed-off-by: Ittay Stern <ittay.stern@att.com>
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/instantiationStatus.e2e.ts2
-rw-r--r--vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.spec.ts11
-rw-r--r--vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.ts2
3 files changed, 12 insertions, 3 deletions
diff --git a/vid-webpack-master/cypress/integration/iFrames/instantiationStatus.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/instantiationStatus.e2e.ts
index 6abd6a3db..3b657343f 100644
--- a/vid-webpack-master/cypress/integration/iFrames/instantiationStatus.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/instantiationStatus.e2e.ts
@@ -28,7 +28,7 @@ describe('Instantiation status', function () {
});
it('should display the correct icons per status', function () {
- const serviceAction:any = {INSTANTIATE : 'Instantiate', DELETE: 'Delete', UPDATE: 'Update'};
+ const serviceAction:any = {INSTANTIATE : 'Instantiate', DELETE: 'Delete', UPDATE: 'Update', UPGRADE: 'Upgrade'};
cy.openIframe('app/ui/#/instantiationStatus');
for(let i = 0 ; i < asyncRes.length; i++){
if(asyncRes[i].project){
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 d115984f6..27d3f419b 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
@@ -139,7 +139,7 @@ describe('Instantiation Status Service', () => {
'STOPPED': 'Stopped: Due to previous failure, will not be instantiated.',
'StOpPeD': 'Stopped: Due to previous failure, will not be instantiated.',
'COMPLETED_WITH_ERRORS': 'Completed with errors: some of the planned actions where successfully committed while other have not.\n Open the service to check it out.',
- 'UNEXPECTED_STATUS': 'Unexpected status: "UNEXPECTED_RANDOM_STATUS"',
+ 'UNEXPECTED_RANDOM_STATUS': 'Unexpected status: "UNEXPECTED_RANDOM_STATUS"',
})) {
test(`getStatusTooltip should return status popover: status=${status}`, () => {
@@ -148,6 +148,12 @@ describe('Instantiation Status Service', () => {
}
+ test(`service.getStatus should handle undefined status`, () => {
+ const statusResult = service.getStatus(undefined);
+ expect(statusResult.tooltip).toEqual('Unexpected status: "undefined"');
+ expect(statusResult.iconClassName).toEqual(UNKNOWN);
+ });
+
test('getStatusTooltip should return correct icon per job status', () => {
let result : ServiceStatus = service.getStatus('pending');
expect(result.iconClassName).toEqual(PENDING);
@@ -172,6 +178,9 @@ describe('Instantiation Status Service', () => {
result = service.getStatus('UNEXPECTED_RANDOM_STATUS');
expect(result.iconClassName).toEqual(UNKNOWN);
+
+ result = service.getStatus(undefined);
+ expect(result.iconClassName).toEqual(UNKNOWN);
});
function generateServiceInfoData(){
diff --git a/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.ts b/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.ts
index 6a85d9da1..ffc2e681a 100644
--- a/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.ts
+++ b/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.ts
@@ -138,7 +138,7 @@ export class InstantiationStatusComponentService {
}
getStatus(status : string) : ServiceStatus {
- switch(status.toUpperCase()) {
+ switch(`${status}`.toUpperCase()) {
case 'PENDING' :
return new ServiceStatus(PENDING, 'primary', 'Pending: The action required will be sent as soon as possible.');
case 'IN_PROGRESS' :