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