});
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){
'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}`, () => {
}
+ 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);
result = service.getStatus('UNEXPECTED_RANDOM_STATUS');
expect(result.iconClassName).toEqual(UNKNOWN);
+
+ result = service.getStatus(undefined);
+ expect(result.iconClassName).toEqual(UNKNOWN);
});
function generateServiceInfoData(){