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