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