diff options
author | Ittay Stern <ittay.stern@att.com> | 2020-01-21 12:20:37 +0200 |
---|---|---|
committer | Ittay Stern <ittay.stern@att.com> | 2020-01-21 15:48:40 +0200 |
commit | 6b1e53d593a958254481f2043f6da8c6c96d4a0b (patch) | |
tree | 69f66ce6d3961c66fec2fc55618a426776715604 /vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts | |
parent | b96cada06214d609d32a38ca89d71cc53169324c (diff) |
originalName may be model's "entry name", customizationId or invariantId
The classic originalName is the "entry name". So two more options
were added through SharedTreeService::modelByIdentifier()
function.
Issue-ID: VID-724
Change-Id: I9f192d2b24c9c1659a95baabd21252bed392e9da
Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts')
-rw-r--r-- | vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts | 30 |
1 files changed, 30 insertions, 0 deletions
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 f89950c61..87094e3bb 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 @@ -166,6 +166,36 @@ describe('Shared Tree Service', () => { expect(MessageBoxService.openModal.next).toHaveBeenCalled(); }); + each([ + ['volumeGroups by entry name', "volumeGroups", + "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1", "2017488PasqualeVpe..PASQUALE_vRE_BV..module-1"], + ['vfmodule by customizationUuid', "vfModules", + "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", "2017488PasqualeVpe..PASQUALE_vRE_BV..module-1"], + ['vnf by customizationUuid', "vnfs", + "1da7b585-5e61-4993-b95e-8e6606c81e45", "2017-488_PASQUALE-vPE 0"], + ['vnfGroups by invariantUuid because no customizationUuid', "vnfGroups", + "4bb2e27e-ddab-4790-9c6d-1f731bc14a45", "groupingservicefortest..ResourceInstanceGroup..0"], + ]).test('modelByIdentifier should success: %s', (description, modelTypeName, modelUniqueIdOrName, expectedModelCustomizationName) => { + let serviceModelFromHierarchy = + getStore().service.serviceHierarchy["1a80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"]; + + expect(service.modelByIdentifier(serviceModelFromHierarchy, modelTypeName, modelUniqueIdOrName)) + .toHaveProperty("modelCustomizationName", expectedModelCustomizationName); + }); + + each([ + ['vfmodule by invariantUuid when there is customizationUuid', "vfModules", "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1"], + ['network by non-existing modelUniqueIdOrName', "networks", "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1"], + ['collectionResource has no resource', "collectionResources", "whatever"], + ['non-existing model-type', "fooBar", "whatever"], + ]).test('modelByIdentifier should fail: %s', (description, modelTypeName, modelUniqueIdOrName) => { + let serviceModelFromHierarchy = + getStore().service.serviceHierarchy["1a80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"]; + + expect(service.modelByIdentifier(serviceModelFromHierarchy, modelTypeName, modelUniqueIdOrName)) + .toBeUndefined(); + }); + test('openAuditInfoModal should open modal for failed instance', () => { jest.spyOn(AuditInfoModalComponent.openInstanceAuditInfoModal, 'next'); |