+ it(`Given a stored template - add one VfModule, edit its details, and deploy - deploy is added with the vfModule details`, () => {
+ loadDrawingBoardWithRecreateMode();
+
+ let newVfModuleName = "new.vfmodule.name";
+ let module1ModelId = "VprobeNcVnf..FE_Add_On_Module_vlbagent_eph..module-1";
+ let module1CustomizationId = `vprobe_nc_vnf0..${module1ModelId}`;
+
+ // Click target VNF on right tree
+ cy.getElementByDataTestsId('node-21ae311e-432f-4c54-b855-446d0b8ded72-vProbe_NC_VNF 0').click();
+
+ // Click [+] vfModule on left tree
+ cy.drawingBoardPressAddButtonByElementName(`node-${module1CustomizationId}`)
+ .click({force: true});
+
+ editNode(`node-c09e4530-8fd8-418f-9483-2f57ce927b05-${module1CustomizationId}`, 1);
+ cy.clearInput("instanceName");
+ cy.typeToInput("instanceName", newVfModuleName);
+ cy.selectDropdownOptionByText('lcpRegion', 'hvf6');
+ cy.selectDropdownOptionByText('tenant', 'DN5242-Nov21-T1');
+ cy.getElementByDataTestsId('form-set').click();
+
+ // Then...
+ cy.getReduxState().then((state) => {
+ let vfModules_1Path = [
+ ...vnfPath, "vfModules", module1CustomizationId,
+ ];
+
+ let serviceInstanceElementOnRedux = state.service.serviceInstance[(templateWithVnfSetup.serviceModelId)];
+ let latestVfModule_1Path = findPathOfLatestVfModule(serviceInstanceElementOnRedux, vfModules_1Path);
+
+ // This is a funny merge, as values are already there, but that way ensures
+ // the values that selected are really deployed, while limiting the cost of
+ // maintenance, by taking other vfModule's fields as granted.
+ let latestVfModule_1ExpectedValue = _.merge(
+ _.get(serviceInstanceElementOnRedux, latestVfModule_1Path),
+ {
+ instanceName: newVfModuleName,
+ volumeGroupName: `${newVfModuleName}_vol`,
+ lcpCloudRegionId: "hvf6",
+ tenantId: "4914ab0ab3a743e58f0eefdacc1dde77",
+ }
+ );
+
+ assertThatBodyFromDeployRequestEqualsToTemplateFromBackEnd([
+ {path: [...vnfPath, "vnfStoreKey"], value: "vProbe_NC_VNF 0"}, // side-effect
+ {path: ["existingNames", newVfModuleName], value: ""},
+ {path: ["existingNames", `${newVfModuleName}_vol`], value: ""},
+ {path: latestVfModule_1Path, value: latestVfModule_1ExpectedValue},
+ {path: ["validationCounter"], value: null}, // side-effect
+ ]);
+ });
+
+ });
+
+ it('Given a template - User can remove existing vfmodule', function () {
+
+ loadDrawingBoardWithRecreateMode();
+ nodeAction('node-c09e4530-8fd8-418f-9483-2f57ce927b05-vprobe_nc_vnf0..VprobeNcVnf..FE_Add_On_Module_vlbagent_eph..module-1', 'Remove');
+ let removed_vfModule_Path = [
+ ...vnfPath, "vfModules",
+ "vprobe_nc_vnf0..VprobeNcVnf..FE_Add_On_Module_vlbagent_eph..module-1",
+ ];
+
+ assertThatBodyFromDeployRequestEqualsToTemplateFromBackEnd([
+ {path: [...vnfPath, "vnfStoreKey"], value: "vProbe_NC_VNF 0"}, // side-effect
+ {path: [...removed_vfModule_Path], value: undefined},
+ ]);
+ });
+