49deb3a507e9baf894e41e8f197b01546b2e6e4e
[vid.git] / vid-webpack-master / src / app / shared / components / genericForm / formControlsServices / vfModuleGenerator / vfModule.control.generator.spec.ts
1 import {getTestBed, TestBed} from '@angular/core/testing';
2 import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing';
3 import {NgRedux} from '@angular-redux/store';
4 import {ControlGeneratorUtil, SDN_C_PRE_LOAD} from "../control.generator.util.service";
5 import {AaiService} from "../../../../services/aaiService/aai.service";
6 import {GenericFormService} from "../../generic-form.service";
7 import {FormBuilder, FormControl, FormGroup} from "@angular/forms";
8 import {LogService} from "../../../../utils/log/log.service";
9 import {
10   FormControlModel,
11   ValidatorModel,
12   ValidatorOptions
13 } from "../../../../models/formControlModels/formControl.model";
14 import {FormControlNames, VfModuleControlGenerator} from "./vfModule.control.generator";
15 import {FeatureFlagsService} from "../../../../services/featureFlag/feature-flags.service";
16 import {VfModuleInstance} from "../../../../models/vfModuleInstance";
17 import {VfModule} from "../../../../models/vfModule";
18 import {SharedControllersService} from "../sharedControlles/shared.controllers.service";
19 import {AppState} from "../../../../store/reducers";
20 import {SharedTreeService} from "../../../../../drawingBoard/service-planning/objectsToTree/shared.tree.service";
21
22 class MockAppStore<T> {
23   getState() {
24     return {
25       "global": {
26         "name": null,
27         "flags": {
28           "FLAG_NETWORK_TO_ASYNC_INSTANTIATION": false,
29           "FLAG_SHOW_ASSIGNMENTS": true,
30           "FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS": true,
31           "FLAG_SHOW_VERIFY_SERVICE": false,
32           "FLAG_SERVICE_MODEL_CACHE": true,
33           "FLAG_ADD_MSO_TESTAPI_FIELD": true
34         },
35         "type": "[FLAGS] Update"
36       },
37       "service": {
38         "serviceHierarchy": {
39           "6e59c5de-f052-46fa-aa7e-2fca9d674c44": {
40             "service": {
41               "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
42               "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
43               "name": "ComplexService",
44               "version": "1.0",
45               "toscaModelURL": null,
46               "category": "Emanuel",
47               "serviceType": "",
48               "serviceRole": "",
49               "description": "ComplexService",
50               "serviceEcompNaming": "false",
51               "instantiationType": "Macro",
52               "inputs": {}
53             },
54             "vnfs": {
55               "VF_vGeraldine 0": {
56                 "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60",
57                 "invariantUuid": "4160458e-f648-4b30-a176-43881ffffe9e",
58                 "description": "VSP_vGeraldine",
59                 "name": "VF_vGeraldine",
60                 "version": "2.0",
61                 "customizationUuid": "91415b44-753d-494c-926a-456a9172bbb9",
62                 "inputs": {},
63                 "commands": {},
64                 "serviceEcompNaming" : "true",
65                 "properties": {
66                   "ecomp_generated_naming": "false",
67                   "max_instances": 10,
68                   "min_instances": 1,
69                   "gpb2_Internal2_mac": "00:11:22:EF:AC:DF",
70                   "sctp-b-ipv6-egress_src_start_port": "0",
71                   "sctp-a-ipv6-egress_rule_application": "any",
72                   "Internal2_allow_transit": "true",
73                   "sctp-b-IPv6_ethertype": "IPv6",
74                   "sctp-a-egress_rule_application": "any",
75                   "sctp-b-ingress_action": "pass",
76                   "sctp-b-ingress_rule_protocol": "icmp",
77                   "ncb2_Internal1_mac": "00:11:22:EF:AC:DF",
78                   "sctp-b-ipv6-ingress-src_start_port": "0.0",
79                   "ncb1_Internal2_mac": "00:11:22:EF:AC:DF",
80                   "fsb_volume_size_0": "320.0",
81                   "sctp-b-egress_src_addresses": "local",
82                   "sctp-a-ipv6-ingress_ethertype": "IPv4",
83                   "sctp-a-ipv6-ingress-dst_start_port": "0",
84                   "sctp-b-ipv6-ingress_rule_application": "any",
85                   "domain_name": "default-domain",
86                   "sctp-a-ingress_rule_protocol": "icmp",
87                   "sctp-b-egress-src_start_port": "0.0",
88                   "sctp-a-egress_src_addresses": "local",
89                   "sctp-b-display_name": "epc-sctp-b-ipv4v6-sec-group",
90                   "sctp-a-egress-src_start_port": "0.0",
91                   "sctp-a-ingress_ethertype": "IPv4",
92                   "sctp-b-ipv6-ingress-dst_end_port": "65535",
93                   "sctp-b-dst_subnet_prefix_v6": "::",
94                   "nf_naming": "{ecomp_generated_naming=true}",
95                   "sctp-a-ipv6-ingress_src_subnet_prefix": "0.0.0.0",
96                   "sctp-b-egress-dst_start_port": "0.0",
97                   "ncb_flavor_name": "nv.c20r64d1",
98                   "gpb1_Internal1_mac": "00:11:22:EF:AC:DF",
99                   "sctp-b-egress_dst_subnet_prefix_len": "0.0",
100                   "Internal2_net_cidr": "10.0.0.10",
101                   "sctp-a-ingress-dst_start_port": "0.0",
102                   "sctp-a-egress-dst_start_port": "0.0",
103                   "fsb1_Internal2_mac": "00:11:22:EF:AC:DF",
104                   "sctp-a-egress_ethertype": "IPv4",
105                   "vlc_st_service_mode": "in-network-nat",
106                   "sctp-a-ipv6-egress_ethertype": "IPv4",
107                   "sctp-a-egress-src_end_port": "65535.0",
108                   "sctp-b-ipv6-egress_rule_application": "any",
109                   "sctp-b-egress_action": "pass",
110                   "sctp-a-ingress-src_subnet_prefix_len": "0.0",
111                   "sctp-b-ipv6-ingress-src_end_port": "65535.0",
112                   "sctp-b-name": "epc-sctp-b-ipv4v6-sec-group",
113                   "fsb2_Internal1_mac": "00:11:22:EF:AC:DF",
114                   "sctp-a-ipv6-ingress-src_start_port": "0.0",
115                   "sctp-b-ipv6-egress_ethertype": "IPv4",
116                   "Internal1_net_cidr": "10.0.0.10",
117                   "sctp-a-egress_dst_subnet_prefix": "0.0.0.0",
118                   "fsb_flavor_name": "nv.c20r64d1",
119                   "sctp_rule_protocol": "132",
120                   "sctp-b-ipv6-ingress_src_subnet_prefix_len": "0",
121                   "sctp-a-ipv6-ingress_rule_application": "any",
122                   "sctp-a-IPv6_ethertype": "IPv6",
123                   "vlc2_Internal1_mac": "00:11:22:EF:AC:DF",
124                   "vlc_st_virtualization_type": "virtual-machine",
125                   "sctp-b-ingress-dst_start_port": "0.0",
126                   "sctp-b-ingress-dst_end_port": "65535.0",
127                   "sctp-a-ipv6-ingress-src_end_port": "65535.0",
128                   "sctp-a-display_name": "epc-sctp-a-ipv4v6-sec-group",
129                   "sctp-b-ingress_rule_application": "any",
130                   "int2_sec_group_name": "int2-sec-group",
131                   "vlc_flavor_name": "nd.c16r64d1",
132                   "sctp-b-ipv6-egress_src_addresses": "local",
133                   "vlc_st_interface_type_int1": "other1",
134                   "sctp-b-egress-src_end_port": "65535.0",
135                   "sctp-a-ipv6-egress-dst_start_port": "0",
136                   "vlc_st_interface_type_int2": "other2",
137                   "sctp-a-ipv6-egress_rule_protocol": "any",
138                   "Internal2_shared": "false",
139                   "sctp-a-ipv6-egress_dst_subnet_prefix_len": "0",
140                   "Internal2_rpf": "disable",
141                   "vlc1_Internal1_mac": "00:11:22:EF:AC:DF",
142                   "sctp-b-ipv6-egress_src_end_port": "65535",
143                   "sctp-a-ipv6-egress_src_addresses": "local",
144                   "sctp-a-ingress-dst_end_port": "65535.0",
145                   "sctp-a-ipv6-egress_src_end_port": "65535",
146                   "Internal1_forwarding_mode": "l2",
147                   "Internal2_dhcp": "false",
148                   "sctp-a-dst_subnet_prefix_v6": "::",
149                   "pxe_image_name": "MME_PXE-Boot_16ACP04_GA.qcow2",
150                   "vlc_st_interface_type_gtp": "other0",
151                   "ncb1_Internal1_mac": "00:11:22:EF:AC:DF",
152                   "sctp-b-src_subnet_prefix_v6": "::",
153                   "sctp-a-egress_dst_subnet_prefix_len": "0.0",
154                   "int1_sec_group_name": "int1-sec-group",
155                   "Internal1_dhcp": "false",
156                   "sctp-a-ipv6-egress_dst_end_port": "65535",
157                   "Internal2_forwarding_mode": "l2",
158                   "fsb2_Internal2_mac": "00:11:22:EF:AC:DF",
159                   "sctp-b-egress_dst_subnet_prefix": "0.0.0.0",
160                   "Internal1_net_cidr_len": "17",
161                   "gpb2_Internal1_mac": "00:11:22:EF:AC:DF",
162                   "sctp-b-ingress-src_subnet_prefix_len": "0.0",
163                   "sctp-a-ingress_dst_addresses": "local",
164                   "sctp-a-egress_action": "pass",
165                   "fsb_volume_type_0": "SF-Default-SSD",
166                   "ncb2_Internal2_mac": "00:11:22:EF:AC:DF",
167                   "vlc_st_interface_type_sctp_a": "left",
168                   "vlc_st_interface_type_sctp_b": "right",
169                   "sctp-a-src_subnet_prefix_v6": "::",
170                   "vlc_st_version": "2",
171                   "sctp-b-egress_ethertype": "IPv4",
172                   "sctp-a-ingress_rule_application": "any",
173                   "gpb1_Internal2_mac": "00:11:22:EF:AC:DF",
174                   "instance_ip_family_v6": "v6",
175                   "sctp-a-ipv6-egress_src_start_port": "0",
176                   "sctp-b-ingress-src_start_port": "0.0",
177                   "sctp-b-ingress_dst_addresses": "local",
178                   "fsb1_Internal1_mac": "00:11:22:EF:AC:DF",
179                   "vlc_st_interface_type_oam": "management",
180                   "multi_stage_design": "true",
181                   "oam_sec_group_name": "oam-sec-group",
182                   "Internal2_net_gateway": "10.0.0.10",
183                   "sctp-a-ipv6-ingress-dst_end_port": "65535",
184                   "sctp-b-ipv6-egress-dst_start_port": "0",
185                   "Internal1_net_gateway": "10.0.0.10",
186                   "sctp-b-ipv6-egress_rule_protocol": "any",
187                   "gtp_sec_group_name": "gtp-sec-group",
188                   "sctp-a-ipv6-egress_dst_subnet_prefix": "0.0.0.0",
189                   "sctp-b-ipv6-egress_dst_subnet_prefix_len": "0",
190                   "sctp-a-ipv6-ingress_dst_addresses": "local",
191                   "sctp-a-egress_rule_protocol": "icmp",
192                   "sctp-b-ipv6-egress_action": "pass",
193                   "sctp-a-ipv6-egress_action": "pass",
194                   "Internal1_shared": "false",
195                   "sctp-b-ipv6-ingress_rule_protocol": "any",
196                   "Internal2_net_cidr_len": "17",
197                   "sctp-a-name": "epc-sctp-a-ipv4v6-sec-group",
198                   "sctp-a-ingress-src_end_port": "65535.0",
199                   "sctp-b-ipv6-ingress_src_subnet_prefix": "0.0.0.0",
200                   "sctp-a-egress-dst_end_port": "65535.0",
201                   "sctp-a-ingress_action": "pass",
202                   "sctp-b-egress_rule_protocol": "icmp",
203                   "sctp-b-ipv6-ingress_action": "pass",
204                   "vlc_st_service_type": "firewall",
205                   "sctp-b-ipv6-egress_dst_end_port": "65535",
206                   "sctp-b-ipv6-ingress-dst_start_port": "0",
207                   "vlc2_Internal2_mac": "00:11:22:EF:AC:DF",
208                   "vlc_st_availability_zone": "true",
209                   "fsb_volume_image_name_1": "MME_FSB2_16ACP04_GA.qcow2",
210                   "sctp-b-ingress-src_subnet_prefix": "0.0.0.0",
211                   "sctp-a-ipv6-ingress_src_subnet_prefix_len": "0",
212                   "Internal1_allow_transit": "true",
213                   "gpb_flavor_name": "nv.c20r64d1",
214                   "availability_zone_max_count": "1",
215                   "fsb_volume_image_name_0": "MME_FSB1_16ACP04_GA.qcow2",
216                   "sctp-b-ipv6-ingress_dst_addresses": "local",
217                   "sctp-b-ipv6-egress_dst_subnet_prefix": "0.0.0.0",
218                   "sctp-b-ipv6-ingress_ethertype": "IPv4",
219                   "vlc1_Internal2_mac": "00:11:22:EF:AC:DF",
220                   "sctp-a-ingress-src_subnet_prefix": "0.0.0.0",
221                   "sctp-a-ipv6-ingress_action": "pass",
222                   "Internal1_rpf": "disable",
223                   "sctp-b-ingress_ethertype": "IPv4",
224                   "sctp-b-egress_rule_application": "any",
225                   "sctp-b-ingress-src_end_port": "65535.0",
226                   "sctp-a-ipv6-ingress_rule_protocol": "any",
227                   "sctp-a-ingress-src_start_port": "0.0",
228                   "sctp-b-egress-dst_end_port": "65535.0"
229                 },
230                 "type": "VF",
231                 "modelCustomizationName": "VF_vGeraldine 0",
232                 "vfModules": {
233                   "vf_vgeraldine0..VfVgeraldine..vflorence_vlc..module-1": {
234                     "uuid": "522159d5-d6e0-4c2a-aa44-5a542a12a830",
235                     "invariantUuid": "98a7c88b-b577-476a-90e4-e25a5871e02b",
236                     "customizationUuid": "55b1be94-671a-403e-a26c-667e9c47d091",
237                     "description": null,
238                     "name": "VfVgeraldine..vflorence_vlc..module-1",
239                     "version": "2",
240                     "modelCustomizationName": "VfVgeraldine..vflorence_vlc..module-1",
241                     "properties": {
242                       "minCountInstances": 0,
243                       "maxCountInstances": null,
244                       "initialCount": 0,
245                       "vfModuleLabel": "vflorence_vlc"
246                     },
247                     "inputs": {},
248                     "volumeGroupAllowed": true
249                   },
250                   "vf_vgeraldine0..VfVgeraldine..vflorence_gpb..module-2": {
251                     "uuid": "41708296-e443-4c71-953f-d9a010f059e1",
252                     "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9",
253                     "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c",
254                     "description": null,
255                     "name": "VfVgeraldine..vflorence_gpb..module-2",
256                     "version": "2",
257                     "modelCustomizationName": "VfVgeraldine..vflorence_gpb..module-2",
258                     "properties": {
259                       "minCountInstances": 0,
260                       "maxCountInstances": null,
261                       "initialCount": 0,
262                       "vfModuleLabel": "vflorence_gpb"
263                     },
264                     "inputs": {},
265                     "volumeGroupAllowed": false
266                   },
267                   "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
268                     "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
269                     "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
270                     "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
271                     "description": null,
272                     "name": "VfVgeraldine..base_vflorence..module-0",
273                     "version": "2",
274                     "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
275                     "properties": {
276                       "minCountInstances": 1,
277                       "maxCountInstances": 1,
278                       "initialCount": 1,
279                       "vfModuleLabel": "base_vflorence"
280                     },
281                     "inputs": {},
282                     "volumeGroupAllowed": true
283                   }
284                 },
285                 "volumeGroups": {
286                   "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
287                     "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
288                     "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
289                     "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
290                     "description": null,
291                     "name": "VfVgeraldine..base_vflorence..module-0",
292                     "version": "2",
293                     "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
294                     "properties": {
295                       "minCountInstances": 1,
296                       "maxCountInstances": 1,
297                       "initialCount": 1,
298                       "vfModuleLabel": "base_vflorence"
299                     },
300                     "inputs": {}
301                   }
302                 },
303                 "vfcInstanceGroups": {}
304               }
305             },
306             "networks": {
307               "ExtVL 0": {
308                 "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b986",
309                 "invariantUuid": "379f816b-a7aa-422f-be30-17114ff50b7c",
310                 "description": "ECOMP generic virtual link (network) base type for all other service-level and global networks",
311                 "name": "ExtVL",
312                 "version": "37.0",
313                 "customizationUuid": "94fdd893-4a36-4d70-b16a-ec29c54c184f",
314                 "inputs": {},
315                 "commands": {},
316                 "properties": {
317                   "ecomp_generated_naming": "false",
318                   "network_assignments": "{is_external_network=false, ipv4_subnet_default_assignment={min_subnets_count=1}, ecomp_generated_network_assignment=false, ipv6_subnet_default_assignment={min_subnets_count=1}}",
319                   "exVL_naming": "{ecomp_generated_naming=true}",
320                   "network_flows": "{is_network_policy=false, is_bound_to_vpn=false}",
321                   "network_homing": "{ecomp_selected_instance_node_target=false}"
322                 },
323                 "type": "VL",
324                 "modelCustomizationName": "ExtVL 0"
325               }
326             },
327             "collectionResources": {},
328             "configurations": {
329               "Port Mirroring Configuration By Policy 0": {
330                 "uuid": "b4398538-e89d-4f13-b33d-ca323434ba50",
331                 "invariantUuid": "6ef0ca40-f366-4897-951f-abd65d25f6f7",
332                 "description": "A port mirroring configuration by policy object",
333                 "name": "Port Mirroring Configuration By Policy",
334                 "version": "27.0",
335                 "customizationUuid": "3c3b7b8d-8669-4b3b-8664-61970041fad2",
336                 "inputs": {},
337                 "commands": {},
338                 "properties": {},
339                 "type": "Configuration",
340                 "modelCustomizationName": "Port Mirroring Configuration By Policy 0",
341                 "sourceNodes": [],
342                 "collectorNodes": null,
343                 "configurationByPolicy": false
344               }
345             },
346             "serviceProxies": {},
347             "vfModules": {
348               "vf_vgeraldine0..VfVgeraldine..vflorence_vlc..module-1": {
349                 "uuid": "522159d5-d6e0-4c2a-aa44-5a542a12a830",
350                 "invariantUuid": "98a7c88b-b577-476a-90e4-e25a5871e02b",
351                 "customizationUuid": "55b1be94-671a-403e-a26c-667e9c47d091",
352                 "description": null,
353                 "name": "VfVgeraldine..vflorence_vlc..module-1",
354                 "version": "2",
355                 "modelCustomizationName": "VfVgeraldine..vflorence_vlc..module-1",
356                 "properties": {
357                   "minCountInstances": 0,
358                   "maxCountInstances": null,
359                   "initialCount": 0,
360                   "vfModuleLabel": "vflorence_vlc"
361                 },
362                 "inputs": {},
363                 "volumeGroupAllowed": true
364               },
365               "vf_vgeraldine0..VfVgeraldine..vflorence_gpb..module-2": {
366                 "uuid": "41708296-e443-4c71-953f-d9a010f059e1",
367                 "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9",
368                 "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c",
369                 "description": null,
370                 "name": "VfVgeraldine..vflorence_gpb..module-2",
371                 "version": "2",
372                 "modelCustomizationName": "VfVgeraldine..vflorence_gpb..module-2",
373                 "properties": {
374                   "minCountInstances": 0,
375                   "maxCountInstances": null,
376                   "initialCount": 0,
377                   "vfModuleLabel": "vflorence_gpb"
378                 },
379                 "inputs": {},
380                 "volumeGroupAllowed": false
381               },
382               "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
383                 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
384                 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
385                 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
386                 "description": null,
387                 "name": "VfVgeraldine..base_vflorence..module-0",
388                 "version": "2",
389                 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
390                 "properties": {
391                   "minCountInstances": 1,
392                   "maxCountInstances": 1,
393                   "initialCount": 1,
394                   "vfModuleLabel": "base_vflorence"
395                 },
396                 "inputs": {},
397                 "volumeGroupAllowed": true
398               }
399             },
400             "volumeGroups": {
401               "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
402                 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
403                 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
404                 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
405                 "description": null,
406                 "name": "VfVgeraldine..base_vflorence..module-0",
407                 "version": "2",
408                 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
409                 "properties": {
410                   "minCountInstances": 1,
411                   "maxCountInstances": 1,
412                   "initialCount": 1,
413                   "vfModuleLabel": "base_vflorence"
414                 },
415                 "inputs": {}
416               }
417             },
418             "pnfs": {}
419           }
420         },
421         "serviceInstance": {
422           "6e59c5de-f052-46fa-aa7e-2fca9d674c44": {
423             "networks": {},
424             "vnfs": {
425               "VF_vGeraldine 0": {
426                 "rollbackOnFailure": "true",
427                 "vfModules": {
428                   "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
429                     "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo": {
430                       "isMissingData": false,
431                       "sdncPreReload": null,
432                       "modelInfo": {
433                         "modelType": "VFmodule",
434                         "modelInvariantId": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
435                         "modelVersionId": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
436                         "modelName": "VfVgeraldine..base_vflorence..module-0",
437                         "modelVersion": "2",
438                         "modelCustomizationId": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
439                         "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0"
440                       },
441                       "instanceParams": [
442                         {}
443                       ],
444                       "trackById": "wmtm6sy2uj"
445                     }
446                   }
447                 },
448                 "isMissingData": true,
449                 "originalName": "VF_vGeraldine 0",
450                 "vnfStoreKey": "VF_vGeraldine 0",
451                 "trackById": "p3wk448m5do",
452                 "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60",
453                 "productFamilyId": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
454                 "lcpCloudRegionId": null,
455                 "tenantId": null,
456                 "lineOfBusiness": null,
457                 "platformName": null,
458                 "modelInfo": {
459                   "modelType": "VF",
460                   "modelInvariantId": "4160458e-f648-4b30-a176-43881ffffe9e",
461                   "modelVersionId": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
462                   "modelName": "VF_vGeraldine",
463                   "modelVersion": "2.0",
464                   "modelCustomizationName": "VF_vGeraldine 0"
465                 }
466               }
467             },
468             "instanceParams": [
469               {}
470             ],
471             "validationCounter": 1,
472             "existingNames": {},
473             "existingVNFCounterMap": {
474               "d6557200-ecf2-4641-8094-5393ae3aae60": 1
475             },
476             "globalSubscriberId": "e433710f-9217-458d-a79d-1c7aff376d89",
477             "subscriptionServiceType": "TYLER SILVIA",
478             "owningEntityId": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc",
479             "productFamilyId": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
480             "lcpCloudRegionId": "hvf6",
481             "tenantId": "229bcdc6eaeb4ca59d55221141d01f8e",
482             "aicZoneId": "JAG1",
483             "projectName": "x1",
484             "rollbackOnFailure": "true",
485             "bulkSize": 1,
486             "modelInfo": {
487               "modelInvariantId": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
488               "modelVersionId": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
489               "modelName": "ComplexService",
490               "modelVersion": "1.0",
491               "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44"
492             },
493             "isALaCarte": false,
494             "name": "ComplexService",
495             "version": "1.0",
496             "description": "ComplexService",
497             "category": "Emanuel",
498             "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
499             "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
500             "serviceType": "",
501             "serviceRole": "",
502             "isEcompGeneratedNaming": true,
503             "isMultiStepDesign": false
504           }
505         },
506         "lcpRegionsAndTenants": {
507           "lcpRegionList": [
508             {
509               "id": "AAIAIC25",
510               "name": "AAIAIC25",
511               "isPermitted": true
512             },
513             {
514               "id": "hvf6",
515               "name": "hvf6",
516               "isPermitted": true
517             }
518           ],
519           "lcpRegionsTenantsMap": {
520             "AAIAIC25": [
521               {
522                 "id": "092eb9e8e4b7412e8787dd091bc58e86",
523                 "name": "USP-SIP-IC-24335-T-01",
524                 "isPermitted": true
525               }
526             ],
527             "hvf6": [
528               {
529                 "id": "bae71557c5bb4d5aac6743a4e5f1d054",
530                 "name": "AIN Web Tool-15-D-testalexandria",
531                 "isPermitted": true
532               },
533               {
534                 "id": "d0a3e3f2964542259d155a81c41aadc3",
535                 "name": "test-hvf6-09",
536                 "isPermitted": true
537               },
538               {
539                 "id": "fa45ca53c80b492fa8be5477cd84fc2b",
540                 "name": "ro-T112",
541                 "isPermitted": true
542               },
543               {
544                 "id": "cbb99fe4ada84631b7baf046b6fd2044",
545                 "name": "DN5242-Nov16-T3",
546                 "isPermitted": true
547               }
548             ]
549           }
550         },
551         "productFamilies": [
552           {
553             "id": "ebc3bc3d-62fd-4a3f-a037-f619df4ff034",
554             "name": "ERICA",
555             "isPermitted": true
556           },
557           {
558             "id": "17cc1042-527b-11e6-beb8-9e71128cae77",
559             "name": "IGNACIO",
560             "isPermitted": true
561           },
562           {
563             "id": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
564             "name": "Christie",
565             "isPermitted": true
566           },
567           {
568             "id": "a4f6f2ae-9bf5-4ed7-b904-06b2099c4bd7",
569             "name": "Enhanced Services",
570             "isPermitted": true
571           },
572           {
573             "id": "vTerrance",
574             "name": "vTerrance",
575             "isPermitted": true
576           },
577           {
578             "id": "323d69d9-2efe-4r45-ay0a-89ea7ard4e6f",
579             "name": "vEsmeralda",
580             "isPermitted": true
581           },
582           {
583             "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
584             "name": "Emanuel",
585             "isPermitted": true
586           },
587           {
588             "id": "d8a6ed93-251c-47ca-adc9-86671fd19f4c",
589             "name": "BVOIP",
590             "isPermitted": true
591           },
592           {
593             "id": "db171b8f-115c-4992-a2e3-ee04cae357e0",
594             "name": "LINDSEY",
595             "isPermitted": true
596           },
597           {
598             "id": "LRSI-OSPF",
599             "name": "LRSI-OSPF",
600             "isPermitted": true
601           },
602           {
603             "id": "vRosemarie",
604             "name": "HNGATEWAY",
605             "isPermitted": true
606           },
607           {
608             "id": "vHNPaas",
609             "name": "WILKINS",
610             "isPermitted": true
611           },
612           {
613             "id": "e433710f-9217-458d-a79d-1c7aff376d89",
614             "name": "TYLER SILVIA",
615             "isPermitted": true
616           },
617           {
618             "id": "b6a3f28c-eebf-494c-a900-055cc7c874ce",
619             "name": "VROUTER",
620             "isPermitted": true
621           },
622           {
623             "id": "vMuriel",
624             "name": "vMuriel",
625             "isPermitted": true
626           },
627           {
628             "id": "0ee8c1bc-7cbd-4b0a-a1ac-e9999255abc1",
629             "name": "CARA Griffin",
630             "isPermitted": true
631           },
632           {
633             "id": "c7611ebe-c324-48f1-8085-94aef0c6ef3d",
634             "name": "DARREN MCGEE",
635             "isPermitted": true
636           },
637           {
638             "id": "e30755dc-5673-4b6b-9dcf-9abdd96b93d1",
639             "name": "Transport",
640             "isPermitted": true
641           },
642           {
643             "id": "vSalvatore",
644             "name": "vSalvatore",
645             "isPermitted": true
646           },
647           {
648             "id": "d7bb0a21-66f2-4e6d-87d9-9ef3ced63ae4",
649             "name": "JOSEFINA",
650             "isPermitted": true
651           },
652           {
653             "id": "vHubbard",
654             "name": "vHubbard",
655             "isPermitted": true
656           },
657           {
658             "id": "12a96a9d-4b4c-4349-a950-fe1159602621",
659             "name": "DARREN MCGEE",
660             "isPermitted": true
661           }
662         ],
663         "serviceTypes": {
664           "e433710f-9217-458d-a79d-1c7aff376d89": [
665             {
666               "id": "0",
667               "name": "vRichardson",
668               "isPermitted": false
669             },
670             {
671               "id": "1",
672               "name": "TYLER SILVIA",
673               "isPermitted": true
674             },
675             {
676               "id": "2",
677               "name": "Emanuel",
678               "isPermitted": false
679             },
680             {
681               "id": "3",
682               "name": "vJamie",
683               "isPermitted": false
684             },
685             {
686               "id": "4",
687               "name": "vVoiceMail",
688               "isPermitted": false
689             },
690             {
691               "id": "5",
692               "name": "Kennedy",
693               "isPermitted": false
694             },
695             {
696               "id": "6",
697               "name": "vPorfirio",
698               "isPermitted": false
699             },
700             {
701               "id": "7",
702               "name": "vVM",
703               "isPermitted": false
704             },
705             {
706               "id": "8",
707               "name": "vOTA",
708               "isPermitted": false
709             },
710             {
711               "id": "9",
712               "name": "vFLORENCE",
713               "isPermitted": false
714             },
715             {
716               "id": "10",
717               "name": "vMNS",
718               "isPermitted": false
719             },
720             {
721               "id": "11",
722               "name": "vEsmeralda",
723               "isPermitted": false
724             },
725             {
726               "id": "12",
727               "name": "VPMS",
728               "isPermitted": false
729             },
730             {
731               "id": "13",
732               "name": "vWINIFRED",
733               "isPermitted": false
734             },
735             {
736               "id": "14",
737               "name": "SSD",
738               "isPermitted": false
739             },
740             {
741               "id": "15",
742               "name": "vMOG",
743               "isPermitted": false
744             },
745             {
746               "id": "16",
747               "name": "LINDSEY",
748               "isPermitted": false
749             },
750             {
751               "id": "17",
752               "name": "JOHANNA_SANTOS",
753               "isPermitted": false
754             },
755             {
756               "id": "18",
757               "name": "vCarroll",
758               "isPermitted": false
759             }
760           ]
761         },
762         "aicZones": [
763           {
764             "id": "NFT1",
765             "name": "NFTJSSSS-NFT1"
766           },
767           {
768             "id": "JAG1",
769             "name": "YUDFJULP-JAG1"
770           },
771           {
772             "id": "YYY1",
773             "name": "UUUAIAAI-YYY1"
774           },
775           {
776             "id": "AVT1",
777             "name": "AVTRFLHD-AVT1"
778           },
779           {
780             "id": "ATL34",
781             "name": "ATLSANAI-ATL34"
782           }
783         ],
784         "categoryParameters": {
785           "owningEntityList": [
786             {
787               "id": "aaa1",
788               "name": "aaa1"
789             },
790             {
791               "id": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc",
792               "name": "WayneHolland"
793             },
794             {
795               "id": "Melissa",
796               "name": "Melissa"
797             }
798           ],
799           "projectList": [
800             {
801               "id": "WATKINS",
802               "name": "WATKINS"
803             },
804             {
805               "id": "x1",
806               "name": "x1"
807             },
808             {
809               "id": "yyy1",
810               "name": "yyy1"
811             }
812           ],
813           "lineOfBusinessList": [
814             {
815               "id": "ONAP",
816               "name": "ONAP"
817             },
818             {
819               "id": "zzz1",
820               "name": "zzz1"
821             }
822           ],
823           "platformList": [
824             {
825               "id": "platform",
826               "name": "platform"
827             },
828             {
829               "id": "xxx1",
830               "name": "xxx1"
831             }
832           ]
833         },
834         "type": "[LCP_REGIONS_AND_TENANTS] Update",
835         "subscribers": [
836           {
837             "id": "CAR_2020_ER",
838             "name": "CAR_2020_ER",
839             "isPermitted": true
840           },
841           {
842             "id": "21014aa2-526b-11e6-beb8-9e71128cae77",
843             "name": "JULIO ERICKSON",
844             "isPermitted": false
845           },
846           {
847             "id": "DHV1707-TestSubscriber-2",
848             "name": "DALE BRIDGES",
849             "isPermitted": false
850           },
851           {
852             "id": "DHV1707-TestSubscriber-1",
853             "name": "LLOYD BRIDGES",
854             "isPermitted": false
855           },
856           {
857             "id": "jimmy-example",
858             "name": "JimmyExampleCust-20161102",
859             "isPermitted": false
860           },
861           {
862             "id": "jimmy-example2",
863             "name": "JimmyExampleCust-20161103",
864             "isPermitted": false
865           },
866           {
867             "id": "ERICA5779-TestSub-PWT-102",
868             "name": "ERICA5779-TestSub-PWT-102",
869             "isPermitted": false
870           },
871           {
872             "id": "ERICA5779-TestSub-PWT-101",
873             "name": "ERICA5779-TestSub-PWT-101",
874             "isPermitted": false
875           },
876           {
877             "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
878             "name": "Emanuel",
879             "isPermitted": false
880           },
881           {
882             "id": "ERICA5779-Subscriber-4",
883             "name": "ERICA5779-Subscriber-5",
884             "isPermitted": false
885           },
886           {
887             "id": "ERICA5779-TestSub-PWT-103",
888             "name": "ERICA5779-TestSub-PWT-103",
889             "isPermitted": false
890           },
891           {
892             "id": "ERICA5779-Subscriber-2",
893             "name": "ERICA5779-Subscriber-2",
894             "isPermitted": false
895           },
896           {
897             "id": "e433710f-9217-458d-a79d-1c7aff376d89",
898             "name": "SILVIA ROBBINS",
899             "isPermitted": true
900           },
901           {
902             "id": "ERICA5779-Subscriber-3",
903             "name": "ERICA5779-Subscriber-3",
904             "isPermitted": false
905           },
906           {
907             "id": "31739f3e-526b-11e6-beb8-9e71128cae77",
908             "name": "CRAIG/ROBERTS",
909             "isPermitted": false
910           }
911         ]
912       }
913     }
914   }
915 }
916
917 class MockFeatureFlagsService {}
918
919 describe('VFModule Control Generator', () => {
920   let injector;
921   let service: VfModuleControlGenerator;
922   let httpMock: HttpTestingController;
923   let store : NgRedux<AppState>;
924
925   beforeAll(done => (async () => {
926     TestBed.configureTestingModule({
927       imports: [HttpClientTestingModule],
928       providers: [VfModuleControlGenerator,
929         GenericFormService,
930         SharedControllersService,
931         ControlGeneratorUtil,
932         AaiService,
933         FormBuilder,
934         LogService,
935         SharedTreeService,
936         {provide:FeatureFlagsService, useClass: MockFeatureFlagsService},
937         {provide: NgRedux, useClass: MockAppStore}]
938     });
939     await TestBed.compileComponents();
940
941     injector = getTestBed();
942     service = injector.get(VfModuleControlGenerator);
943     httpMock = injector.get(HttpTestingController);
944     store = injector.get(NgRedux);
945     jest.spyOn(console, 'error');
946
947   })().then(done).catch(done.fail));
948
949   test(' getMacroFormControls gets vnfStoreKey === null', () => {
950     const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
951     const vnfStoreKey: string = null;
952     const vfModuleStoreKey: string = 'vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0';
953     const vfModuleUUID: string = "522159d5-d6e0-4c2a-aa44-5a542a12a830";
954     const controls: FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vfModuleStoreKey, vfModuleUUID, true);
955
956     expect(controls).toEqual([]);
957     expect(console.error).toHaveBeenCalled();
958   });
959
960   test('getAlaCarteFormControls check for mandatory controls', () => {
961     const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
962     const vnfStoreKey: string = 'VF_vGeraldine 0';
963     const vfModuleStoreKey: string = 'vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0';
964     const uuidData: Object = {
965       modelId : "522159d5-d6e0-4c2a-aa44-5a542a12a830",
966       modelName :  "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0",
967       serviceId : "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
968       type : "VFmodule",
969       vFModuleStoreKey : "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo",
970       vnfStoreKey : "VF_vGeraldine 0"
971     };
972     const controls: FormControlModel[] = service.getAlaCarteFormControls(serviceId, vnfStoreKey, vfModuleStoreKey, uuidData, true);
973
974     const mandatoryControls : string[] = [
975       FormControlNames.INSTANCE_NAME,
976       FormControlNames.LCPCLOUD_REGION_ID,
977       FormControlNames.TENANT_ID,
978       FormControlNames.ROLLBACK_ON_FAILURE,
979     ];
980
981     for(let i = 0 ; i < mandatoryControls.length ; i++) {
982       let requiredExist = controls.find(ctrl => ctrl.controlName === mandatoryControls[i]).validations.find(item => item.validatorName === 'required');
983       expect(requiredExist).toBeDefined();
984     }
985   });
986
987
988   const cases = [
989     [true, true, true, null, true, true],
990     [true, true, false, null, true, false], //Scenario to check that UI field doesn't appear.
991     [false, true, false, "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0_vol", true, true],
992     [false, true, true, "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0_vol", true, true],
993     [false, false, true, null, false, false],
994   ];
995
996   test.each(cases)('Given Ecomp Gen Name: %p and VG Name %p , ' +
997     'is A La Carte %p - expect the name value for VG to be %p , ' +
998     'VG Name should be defined: %p , and should the field be visible: %p',
999     (ecomGenName, vGName, isALaCarte, expectedName, shouldWeVerifyDefinitionOfField, isVisible) => {
1000     const moduleName = "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0";
1001     service.vfModuleModel = new VfModule();
1002     service.vfModuleModel.name = moduleName;
1003     service.vfModuleModel.volumeGroupAllowed = vGName;
1004     let vnf : Object =  {isEcompGeneratedNaming: ecomGenName};
1005     const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
1006     const vnfStoreKey: string = 'VF_vGeraldine 0';
1007     const uuidData: Object = {
1008       modelName :  moduleName,
1009       vFModuleStoreKey : "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo",
1010     };
1011     const vfModuleModel :VfModuleInstance = service.getVfModuleInstance(serviceId, vnfStoreKey, uuidData,true);
1012     let existingMatchingFieldInForm = buildVfModuleFormControlModel(vfModuleModel ,serviceId, vnf, isALaCarte);
1013       if (shouldWeVerifyDefinitionOfField) {
1014         expect(existingMatchingFieldInForm).toBeDefined();
1015         expect(existingMatchingFieldInForm.value).toEqual(expectedName);
1016         expect(existingMatchingFieldInForm.isVisible).toEqual(isVisible);
1017       } else {
1018         expect(existingMatchingFieldInForm).toBeUndefined();
1019       }
1020     });
1021
1022   let buildVfModuleFormControlModel = function(vfModuleModel :any, serviceId: string, vnf, isALaCarte) :FormControlModel {
1023     let controls: FormControlModel[] = service.pushInstanceAndVGToForm([], vfModuleModel, serviceId, vnf, isALaCarte);
1024     return controls.find(ctrl => ctrl.controlName === FormControlNames.VOLUME_GROUP_NAME);
1025   };
1026
1027   test('getMacroFormControls check for mandatory controls', () => {
1028     const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
1029     const vnfStoreKey: string = 'VF_vGeraldine 0';
1030     const uuidData: Object = {
1031       modelId : "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
1032       modelName :  "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0",
1033       serviceId : "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
1034       type : "VFmodule",
1035       vFModuleStoreKey : "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo",
1036       vnfStoreKey : "VF_vGeraldine 0"
1037     };
1038     const controls: FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vnfStoreKey, uuidData, true);
1039
1040     const mandatoryControls : string[] = [
1041       'instanceName'
1042     ];
1043
1044     for(let i = 0 ; i < mandatoryControls.length ; i++) {
1045       let requiredExist = controls.find(ctrl => ctrl.controlName === mandatoryControls[i]).validations.find(item => item.validatorName === 'required');
1046       expect(requiredExist).toBeDefined();
1047     }
1048   });
1049
1050   test(' getMacroFormControls gets null vnfStoreKey', () => {
1051     const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
1052     const vnfStoreKey: string = null;
1053     const vfModuleUUID: string = "522159d5-d6e0-4c2a-aa44-5a542a12a830";
1054     const uuidData: Object = {};
1055     const controls: FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vfModuleUUID, uuidData,true);
1056
1057     expect(controls).toEqual([]);
1058     expect(console.error).toHaveBeenCalled();
1059   });
1060
1061   test('getAlaCarteFormControls should return the correct order of controls', () => {
1062     const controls:FormControlModel[] = getAlaCarteFormControls();
1063
1064     const orderedControls : string[] = [
1065       FormControlNames.INSTANCE_NAME,
1066       FormControlNames.VOLUME_GROUP_NAME,
1067       FormControlNames.LCPCLOUD_REGION_ID,
1068       FormControlNames.LEGACY_REGION,
1069       FormControlNames.TENANT_ID,
1070       FormControlNames.ROLLBACK_ON_FAILURE,
1071       SDN_C_PRE_LOAD,
1072     ];
1073
1074     expect(controls.length).toEqual(7);
1075     for(let i = 0 ; i < orderedControls.length ; i++) {
1076      expect(controls[i].controlName).toEqual(orderedControls[i]);
1077     }
1078   });
1079
1080   function getAlaCarteFormControls():FormControlModel[] {
1081     const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
1082     const vnfStoreKey: string = 'VF_vGeraldine 0';
1083     const vfModuleUUID: string = "522159d5-d6e0-4c2a-aa44-5a542a12a830";
1084     const uuidData: Object = {
1085       modelId: "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
1086       modelName: "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0",
1087       serviceId: "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
1088       type: "VFmodule",
1089       vFModuleStoreKey: "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo",
1090       vnfStoreKey: "VF_vGeraldine 0"
1091     };
1092     const controls: FormControlModel[] = service.getAlaCarteFormControls(serviceId, vnfStoreKey, vfModuleUUID, uuidData, true);
1093     return controls;
1094   }
1095
1096   test('getAlaCarteFormControls responce with wrong order of controls', () => {
1097     const controls:FormControlModel[] = getAlaCarteFormControls();
1098
1099     const orderedControls : string[] = [
1100       FormControlNames.INSTANCE_NAME,
1101       FormControlNames.VOLUME_GROUP_NAME,
1102       FormControlNames.LCPCLOUD_REGION_ID,
1103       FormControlNames.TENANT_ID, // TENANT_ID must be after LEGACY_REGION
1104       FormControlNames.LEGACY_REGION,
1105       FormControlNames.ROLLBACK_ON_FAILURE,
1106       SDN_C_PRE_LOAD,
1107     ];
1108
1109     for(let i = 0 ; i < orderedControls.length ; i++) {
1110       if (controls[i].controlName === 'legacyRegion') {
1111         expect(orderedControls[i]).toEqual('tenantId');
1112       }
1113     }
1114   });
1115
1116   test('getMacroFormControls should return the correct order of controls', () => {
1117     const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
1118     const vnfStoreKey: string = 'VF_vGeraldine 0';
1119     const vfModuleUUID: string = "522159d5-d6e0-4c2a-aa44-5a542a12a830";
1120     const uuidData: Object = {
1121       modelId : "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
1122       modelName :  "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0",
1123       serviceId : "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
1124       type : "VFmodule",
1125       vFModuleStoreKey : "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo",
1126       vnfStoreKey : "VF_vGeraldine 0"
1127     };
1128     const controls: FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vfModuleUUID, uuidData, true);
1129
1130     const orderedControls : string[] = [
1131       FormControlNames.INSTANCE_NAME,
1132       FormControlNames.VOLUME_GROUP_NAME
1133     ];
1134
1135     for(let i = 0 ; i < orderedControls.length ; i++) {
1136       expect(controls[i].controlName).toEqual(orderedControls[i]);
1137     }
1138   });
1139
1140   test.each`
1141     controllerName
1142     ${'instanceName'}
1143     ${'volumeGroupName'}
1144   `('getAlacartFormControls $controllerName control validator shall have the expected regex', ({controllerName}) => {
1145     const controls:FormControlModel[] = getAlaCarteFormControls();
1146
1147     const instanceNameControl: FormControlModel = <FormControlModel>controls.find(item => item.controlName == controllerName);
1148     const instanceNameValidator: ValidatorModel = instanceNameControl.validations.find(val => val.validatorName === ValidatorOptions.pattern);
1149     expect(instanceNameValidator.validatorArg).toEqual(/^[a-zA-Z0-9._-]*$/);
1150   });
1151
1152   test(' getAlaCarteFormControls gets null service', () => {
1153     const controls:FormControlModel[] = getAlaCarteFormControls();
1154     expect(controls.length).toEqual(7);
1155
1156     const orderedControls : string[] = [
1157       FormControlNames.INSTANCE_NAME,
1158       FormControlNames.VOLUME_GROUP_NAME,
1159       FormControlNames.LCPCLOUD_REGION_ID,
1160       FormControlNames.LEGACY_REGION,
1161       FormControlNames.TENANT_ID,
1162       FormControlNames.ROLLBACK_ON_FAILURE,
1163       SDN_C_PRE_LOAD,
1164     ];
1165
1166     for(let i = 0 ; i < orderedControls.length ; i++) {
1167       expect(controls[i].controlName).toEqual(orderedControls[i]);
1168     }
1169   });
1170
1171
1172   test('when flag is active - response should contains upload file', ()=>{
1173     spyOn(store, 'getState').and.returnValue( {
1174       "global": {
1175         "flags": {
1176           "FLAG_2006_VFM_SDNC_PRELOAD_FILES" : true
1177         }
1178       }
1179     });
1180
1181     const extraContent = service.getSdncExtraContents();
1182     console.log("extraContent", extraContent);
1183     const uploadFileData = <any>extraContent[0];
1184
1185     expect(uploadFileData.type).toEqual('UPLOAD_FILE');
1186     expect(uploadFileData.dataTestId).toEqual('sdnc_pereload_upload_link');
1187     expect(uploadFileData.uploadMethod).toBeDefined();
1188     expect(uploadFileData.isDisabled).toBeDefined();
1189     expect(uploadFileData.onSuccess).toBeDefined();
1190     expect(uploadFileData.onFailed).toBeDefined();
1191
1192   })
1193
1194 });
1195