"xbitestmodulereplace0..XbiTestModuleReplace..base_ocg..module-0": {
"b0732bed-3ddf-43cc-b193-7f18db84e476": {
"action": "None_Upgrade",
- "retainAssignments" : false,
- "sdncPreLoad" : true,
+ "retainAssignments" : true,
+ "sdncPreLoad" : false,
"instanceName": "PST-VfMod-Replace-5-Vfmod",
"instanceId": "b0732bed-3ddf-43cc-b193-7f18db84e476",
"orchStatus": "Active",
}
],
"requestParameters": {
- "retainAssignments": false,
- "usePreload" : true,
+ "retainAssignments": true,
+ "usePreload" : false,
"userParams": [],
"testApi": "GR_API"
},
"platformName": null,
"productFamilyId": null,
"provStatus": null,
- "retainAssignments": false,
- "retainVolumeGroups": false,
- "sdncPreLoad": true,
+ "retainAssignments": true,
+ "retainVolumeGroups": true,
+ "sdncPreLoad": false,
"supplementaryFile": null,
"supplementaryFile_hidden": null,
"supplementaryFile_hidden_content": null,
import {DropdownFormControl} from "../../../../models/formControlModels/dropdownFormControl.model";
import {FormControlModel, ValidatorOptions} from "../../../../models/formControlModels/formControl.model";
import {ControlGeneratorUtil} from "../control.generator.util.service";
+import each from "jest-each";
describe('Shared Controllers Service', () => {
expect(lcpRegionControl.isDisabled).toBeFalsy();
});
- test('sdn-preload checkbox is visible', () => {
- const instance = {};
- const sdncPreload: FormControlModel = service.getSDNCControl(instance);
+ each(
+ [
+ [' checked', true, true],
+ [' not checked', false, false ]
+ ]
+ ).
+ test('sdn-preload checkbox is %s', (
+ description: string, checkedByDefault: boolean, expected: boolean
+ ) => {
+ const instance = null;
+ const sdncPreload: FormControlModel = service.getSDNCControl(instance, checkedByDefault);
expect (sdncPreload.displayName).toEqual('SDN-C pre-load');
- expect (sdncPreload.value).toBeFalsy();
+ expect (sdncPreload.value).toBe(expected);
});
test('getlegacyRegion with AAIAIC25 - isVisible true', () => {
tenantsControl['hasEmptyOptions'] = tenants && tenants.length === 0;
};
- getSDNCControl = (instance: any, extraContents? : object[]): FormControlModel => {
+
+ getSDNCControl = (instance: any, checkedByDefault: boolean, extraContents? : object[]): FormControlModel => {
return new CheckboxFormControl({
controlName: SDN_C_PRE_LOAD,
displayName: 'SDN-C pre-load',
dataTestId: 'sdncPreLoad',
- value: instance ? instance.sdncPreLoad : false,
+ value: instance ? instance.sdncPreLoad : checkedByDefault,
validations: [new ValidatorModel(ValidatorOptions.required, 'is required')],
extraContents
})
result.push(this._sharedControllersService.getTenantControl(serviceId, vfModuleInstance));
}
result.push(this._sharedControllersService.getRollbackOnFailureControl(vfModuleInstance));
- result.push(this._sharedControllersService.getSDNCControl(vfModuleInstance, this.getSdncExtraContents()));
+ result.push(this._sharedControllersService.getSDNCControl(vfModuleInstance, false, this.getSdncExtraContents()));
if (this.store.getState().global.flags['FLAG_SUPPLEMENTARY_FILE']) {
result = this._basicControlGenerator.concatSupplementaryFile(result, vfModuleInstance);
}
getControls(serviceId: string, vnfStoreKey: string, vfModuleStoreKey: string, isUpdateMode: boolean): FormControlModel[] {
let result: FormControlModel[] =[
this.getRetainAssignmentsControl(),
- this._sharedControllersService.getSDNCControl(null)
+ this._sharedControllersService.getSDNCControl(null, true)
];
+
const vfModuleInstance :VfModuleInstance = this._vfModuleControlGenerator.getVfModuleInstance(serviceId, vnfStoreKey, this.uuidData, isUpdateMode);
let volumeGroupAllowed = this._store.getState().service.serviceHierarchy[serviceId].vfModules[this.uuidData['modelName']].volumeGroupAllowed;
controlName: UpgradeFormControlNames.RETAIN_VOLUME_GROUPS,
displayName: 'Retain Volume Groups',
dataTestId: UpgradeFormControlNames.RETAIN_VOLUME_GROUPS,
- value: true,
+ value: false,
validations: []
})
};
controlName: UpgradeFormControlNames.RETAIN_ASSIGNMENTS,
displayName: 'Retain Assignments',
dataTestId: UpgradeFormControlNames.RETAIN_ASSIGNMENTS,
- value: true,
+ value: false,
validations: []
})
};
}
}
- test('get controls should return retainAssignments control with true value', ()=> {
- getControlByNameAndCheckValue(UpgradeFormControlNames.RETAIN_ASSIGNMENTS, true, true);
+ test('get controls should return retainAssignments control with false', ()=> {
+ getControlByNameAndCheckValue(UpgradeFormControlNames.RETAIN_ASSIGNMENTS, false, true);
});
- test('get controls should return retainVolumeGroup control with true value', ()=> {
- getControlByNameAndCheckValue(UpgradeFormControlNames.RETAIN_VOLUME_GROUPS, true, true);
+ test('get controls should return retainVolumeGroup control with false', ()=> {
+ getControlByNameAndCheckValue(UpgradeFormControlNames.RETAIN_VOLUME_GROUPS, false, true);
});
[true, false].forEach(notExistsOnModel => {
jest.spyOn(_sharedTreeService, 'isVfModuleCustomizationIdNotExistsOnModel').mockReturnValue(notExistsOnModel);
- getControlByNameAndCheckValue(UpgradeFormControlNames.RETAIN_VOLUME_GROUPS, true, notExistsOnModel);
+ getControlByNameAndCheckValue(UpgradeFormControlNames.RETAIN_VOLUME_GROUPS, false, notExistsOnModel);
});
});
});
- test( 'get controls should return usePreload with false value', () => {
- getControlByNameAndCheckValue(SDN_C_PRE_LOAD, false, true);
+ test( 'get controls should return usePreload with true value', () => {
+ getControlByNameAndCheckValue(SDN_C_PRE_LOAD, true, true);
});
});