Upgrade vfModule popup: show modelVersionId and invariantiD from instance or model.
Issue-ID: Issue-ID: VID-771
Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com>
Change-Id: I2132df5557d346537a9283c5f7147f47f1da36af
Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com>
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts
index c0a1591..fcef504 100644
--- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts
+++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts
@@ -44,7 +44,6 @@
import {SharedControllersService} from "../../../shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service";
import {ModalService} from "../../../shared/components/customModal/services/modal.service";
import {CreateDynamicComponentService} from "../../../shared/components/customModal/services/create-dynamic-component.service";
-import {instance} from "ts-mockito";
class MockAppStore<T> {
getState() {
@@ -289,6 +288,29 @@
expect(actualResult).toEqual(expectedResult);
});
+ each([
+ ['UUID from instance', getSelectedModelInfo(), getNetworkModelInfoFromHierarchy(),"UUID-from-instance" ],
+ ['UUID from instance', getSelectedModelInfo(), null,"UUID-from-instance" ],
+ ['UUID from hierarchy', null, getNetworkModelInfoFromHierarchy(),"UUID-from-hierarchy" ],
+ ['UUID undefined', null, null, undefined],
+
+ ]).
+ test('getModelVersionIdEitherFromInstanceOrFromHierarchy should %s', (description, instance, model, expectedResult) => {
+ let actualUuid = service.getModelVersionIdEitherFromInstanceOrFromHierarchy(instance, model);
+ expect(actualUuid).toEqual(expectedResult);
+ });
+
+ each([
+ ['from instance', getSelectedModelInfo(), getNetworkModelInfoFromHierarchy(), 'invariantId-from-instance'],
+ ['from instance', getSelectedModelInfo(), null, 'invariantId-from-instance'],
+ ['from hierarchy', null, getNetworkModelInfoFromHierarchy(), 'invariantId-from-hierarchy'],
+ ['undefined', null, null, undefined],
+ ]).
+ test('getModelInvariantIdEitherFromInstanceOrFromHierarchy should return invariantId %s', (description, instance, model, expectedInvariantId) =>{
+ let actualInvariantId = service.getModelInvariantIdEitherFromInstanceOrFromHierarchy(instance, model);
+ expect(actualInvariantId).toEqual(expectedInvariantId);
+ });
+
test('statusProperties should be prop on node according to node properties', () => {
let node = service.addingStatusProperty({orchStatus: 'completed', provStatus: 'inProgress', inMaint: false});
expect(node.statusProperties).toBeDefined();
@@ -1534,7 +1556,9 @@
function getNetworkModelInfoFromHierarchy(){
return {
"version": "2.0",
- "customizationUuid":"customization-id-from-hierarchy"
+ "customizationUuid":"customization-id-from-hierarchy",
+ "uuid": "UUID-from-hierarchy",
+ "invariantUuid": "invariantId-from-hierarchy"
}
}
@@ -1542,7 +1566,9 @@
return {
"instanceModelInfo": {
"modelVersion": "5.0",
- "modelCustomizationId": "model-customization-id-from-instance"
+ "modelCustomizationId": "model-customization-id-from-instance",
+ "modelVersionId": "UUID-from-instance",
+ "modelInvariantId": "invariantId-from-instance"
}
}
}