diff options
author | Amichai Hemli <amichai.hemli@intl.att.com> | 2019-10-30 14:32:35 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-10-30 14:32:35 +0000 |
commit | 4c2176675390925c1a6b576ad62541106682c951 (patch) | |
tree | 9e30405b59447a59f4194d9bcf7864c3d3085b82 /vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.spec.ts | |
parent | c638391d22999bd61243794a1981d7476bfdbd5f (diff) | |
parent | c439c8193a2f819586b0ca9bb1b219a5c110e092 (diff) |
Merge "Instantiation-Status: default on unexpected/undefined statuses (fix)"
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.ts | 11 |
1 files changed, 10 insertions, 1 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 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(){ |