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