fix some methods signature to be more TypeScript 19/98919/1
authorEylon Malin <eylon.malin@intl.att.com>
Thu, 28 Nov 2019 07:53:16 +0000 (09:53 +0200)
committerEylon Malin <eylon.malin@intl.att.com>
Thu, 28 Nov 2019 07:53:16 +0000 (09:53 +0200)
Issue-ID: VID-603
Signed-off-by: Eylon Malin <eylon.malin@intl.att.com>
Change-Id: I50225f014abf0717b779f15f22a2185f1f92650b

vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vfModuleUpgrade/vfModule.upgrade.popuop.service.ts
vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vfModuleUpgrade/vfModule.upgrade.popup.service.spec.ts

index 0102686..bbfe870 100644 (file)
@@ -40,7 +40,7 @@ export class VfModuleUpgradePopupService extends VfModulePopupServiceBase {
 
   getDynamicInputs = () => null;
 
-  getControls(serviceId: string, vnfStoreKey: string, vfModuleStoreKey: string, isUpdateMode: boolean)  {
+  getControls(serviceId: string, vnfStoreKey: string, vfModuleStoreKey: string, isUpdateMode: boolean): FormControlModel[]  {
     let result: FormControlModel[] =[
       this.getRetainAssignmentsControl(),
       this.getRetainVolumeGroupsControl(),
index e20964d..7c1cc08 100644 (file)
@@ -19,6 +19,7 @@ import {instance, mock} from "ts-mockito";
 import {GeneralActions} from "../../../../storeUtil/utils/general/general.actions";
 import {VfModuleActions} from "../../../../storeUtil/utils/vfModule/vfModule.actions";
 import {ServiceActions} from "../../../../storeUtil/utils/service/service.actions";
+import {FormControlModel} from "../../../../models/formControlModels/formControl.model";
 
 class MockModalService<T> {}
 
@@ -94,13 +95,13 @@ describe('VFModule popup service', () => {
     expect(service.getTitle()).toBe("Upgrade Module")
   });
 
-  function findControlByName(controls, controlName) {
+  function findControlByName(controls: FormControlModel[], controlName: string) : FormControlModel {
     return controls.find((control) => {
       return control.controlName === controlName;
     });
   }
 
-  function getControlByNameAndCheckValue(controlName, expectedValue ) {
+  function getControlByNameAndCheckValue(controlName: string, expectedValue: any) {
     const controls = service.getControls('serviceId', 'vnfStoreKey', 'vfModuleId', true);
     const control = findControlByName(controls, controlName);
     expect(control).toBeDefined();