- test('get controls should NOT return retainVolumeGroup control with true value', ()=> {
- let stateCopy =_.cloneDeep(store.getState());
- stateCopy.service.serviceHierarchy['serviceId'].vfModules['vfModuleName'].volumeGroupAllowed = false;
- jest.spyOn(store, 'getState').mockReturnValue(stateCopy);
- getControlByNameAndCheckValue(UpgradeFormControlNames.RETAIN_VOLUME_GROUPS, null, false);
+ [true, false].forEach(notExistsOnModel => {
+ test(`retainVolumeGroup control is shown when vfModule not from model (notExistsOnModel=${notExistsOnModel})`, () => {
+ let stateCopy = _.cloneDeep(store.getState());
+ stateCopy.service.serviceHierarchy['serviceId'].vfModules['vfModuleName'].volumeGroupAllowed = false;
+ jest.spyOn(store, 'getState').mockReturnValue(stateCopy);
+
+ jest.spyOn(_sharedTreeService, 'isVfModuleCustomizationIdNotExistsOnModel').mockReturnValue(notExistsOnModel);
+
+ getControlByNameAndCheckValue(UpgradeFormControlNames.RETAIN_VOLUME_GROUPS, true, notExistsOnModel);
+ });