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 {FormControlNames} from "../service.control.generator";
5 import {BasicControlGenerator} from "../basic.control.generator";
6 import {AaiService} from "../../../../services/aaiService/aai.service";
7 import {GenericFormService} from "../../generic-form.service";
8 import {FormBuilder} from "@angular/forms";
13 } from "../../../../models/formControlModels/formControl.model";
14 import {LogService} from "../../../../utils/log/log.service";
15 import {VnfControlGenerator} from "./vnf.control.generator";
16 import {Observable} from "rxjs";
17 import {SelectOption} from "../../../../models/selectOption";
18 import {FeatureFlagsService} from "../../../../services/featureFlag/feature-flags.service";
19 import {FormControlType} from "../../../../models/formControlModels/formControlTypes.enum";
21 class MockAppStore<T> {
27 "FLAG_NETWORK_TO_ASYNC_INSTANTIATION": false,
28 "FLAG_SHOW_ASSIGNMENTS": true,
29 "FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS": true,
30 "FLAG_SHOW_VERIFY_SERVICE": false,
31 "FLAG_SERVICE_MODEL_CACHE": true,
32 "FLAG_SETTING_DEFAULTS_IN_DRAWING_BOARD": false,
33 "FLAG_ADD_MSO_TESTAPI_FIELD": true
35 "type": "[FLAGS] Update"
39 "6e59c5de-f052-46fa-aa7e-2fca9d674c44": {
41 "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
42 "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
43 "name": "ComplexService",
45 "toscaModelURL": null,
46 "category": "Emanuel",
49 "description": "ComplexService",
50 "serviceEcompNaming": "false",
51 "instantiationType": "Macro",
56 "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60",
57 "invariantUuid": "4160458e-f648-4b30-a176-43881ffffe9e",
58 "description": "VSP_vGeraldine",
59 "name": "VF_vGeraldine",
61 "customizationUuid": "91415b44-753d-494c-926a-456a9172bbb9",
67 "gpb2_Internal2_mac": "00:11:22:EF:AC:DF",
68 "sctp-b-ipv6-egress_src_start_port": "0",
69 "sctp-a-ipv6-egress_rule_application": "any",
70 "Internal2_allow_transit": "true",
71 "sctp-b-IPv6_ethertype": "IPv6",
72 "sctp-a-egress_rule_application": "any",
73 "sctp-b-ingress_action": "pass",
74 "sctp-b-ingress_rule_protocol": "icmp",
75 "ncb2_Internal1_mac": "00:11:22:EF:AC:DF",
76 "sctp-b-ipv6-ingress-src_start_port": "0.0",
77 "ncb1_Internal2_mac": "00:11:22:EF:AC:DF",
78 "fsb_volume_size_0": "320.0",
79 "sctp-b-egress_src_addresses": "local",
80 "sctp-a-ipv6-ingress_ethertype": "IPv4",
81 "sctp-a-ipv6-ingress-dst_start_port": "0",
82 "sctp-b-ipv6-ingress_rule_application": "any",
83 "domain_name": "default-domain",
84 "sctp-a-ingress_rule_protocol": "icmp",
85 "sctp-b-egress-src_start_port": "0.0",
86 "sctp-a-egress_src_addresses": "local",
87 "sctp-b-display_name": "epc-sctp-b-ipv4v6-sec-group",
88 "sctp-a-egress-src_start_port": "0.0",
89 "sctp-a-ingress_ethertype": "IPv4",
90 "sctp-b-ipv6-ingress-dst_end_port": "65535",
91 "sctp-b-dst_subnet_prefix_v6": "::",
92 "nf_naming": "{ecomp_generated_naming=true}",
93 "sctp-a-ipv6-ingress_src_subnet_prefix": "0.0.0.0",
94 "sctp-b-egress-dst_start_port": "0.0",
95 "ncb_flavor_name": "nv.c20r64d1",
96 "gpb1_Internal1_mac": "00:11:22:EF:AC:DF",
97 "sctp-b-egress_dst_subnet_prefix_len": "0.0",
98 "Internal2_net_cidr": "10.0.0.10",
99 "sctp-a-ingress-dst_start_port": "0.0",
100 "sctp-a-egress-dst_start_port": "0.0",
101 "fsb1_Internal2_mac": "00:11:22:EF:AC:DF",
102 "sctp-a-egress_ethertype": "IPv4",
103 "vlc_st_service_mode": "in-network-nat",
104 "sctp-a-ipv6-egress_ethertype": "IPv4",
105 "sctp-a-egress-src_end_port": "65535.0",
106 "sctp-b-ipv6-egress_rule_application": "any",
107 "sctp-b-egress_action": "pass",
108 "sctp-a-ingress-src_subnet_prefix_len": "0.0",
109 "sctp-b-ipv6-ingress-src_end_port": "65535.0",
110 "sctp-b-name": "epc-sctp-b-ipv4v6-sec-group",
111 "fsb2_Internal1_mac": "00:11:22:EF:AC:DF",
112 "sctp-a-ipv6-ingress-src_start_port": "0.0",
113 "sctp-b-ipv6-egress_ethertype": "IPv4",
114 "Internal1_net_cidr": "10.0.0.10",
115 "sctp-a-egress_dst_subnet_prefix": "0.0.0.0",
116 "fsb_flavor_name": "nv.c20r64d1",
117 "sctp_rule_protocol": "132",
118 "sctp-b-ipv6-ingress_src_subnet_prefix_len": "0",
119 "sctp-a-ipv6-ingress_rule_application": "any",
120 "ecomp_generated_naming": "false",
121 "sctp-a-IPv6_ethertype": "IPv6",
122 "vlc2_Internal1_mac": "00:11:22:EF:AC:DF",
123 "vlc_st_virtualization_type": "virtual-machine",
124 "sctp-b-ingress-dst_start_port": "0.0",
125 "sctp-b-ingress-dst_end_port": "65535.0",
126 "sctp-a-ipv6-ingress-src_end_port": "65535.0",
127 "sctp-a-display_name": "epc-sctp-a-ipv4v6-sec-group",
128 "sctp-b-ingress_rule_application": "any",
129 "int2_sec_group_name": "int2-sec-group",
130 "vlc_flavor_name": "nd.c16r64d1",
131 "sctp-b-ipv6-egress_src_addresses": "local",
132 "vlc_st_interface_type_int1": "other1",
133 "sctp-b-egress-src_end_port": "65535.0",
134 "sctp-a-ipv6-egress-dst_start_port": "0",
135 "vlc_st_interface_type_int2": "other2",
136 "sctp-a-ipv6-egress_rule_protocol": "any",
137 "Internal2_shared": "false",
138 "sctp-a-ipv6-egress_dst_subnet_prefix_len": "0",
139 "Internal2_rpf": "disable",
140 "vlc1_Internal1_mac": "00:11:22:EF:AC:DF",
141 "sctp-b-ipv6-egress_src_end_port": "65535",
142 "sctp-a-ipv6-egress_src_addresses": "local",
143 "sctp-a-ingress-dst_end_port": "65535.0",
144 "sctp-a-ipv6-egress_src_end_port": "65535",
145 "Internal1_forwarding_mode": "l2",
146 "Internal2_dhcp": "false",
147 "sctp-a-dst_subnet_prefix_v6": "::",
148 "pxe_image_name": "MME_PXE-Boot_16ACP04_GA.qcow2",
149 "vlc_st_interface_type_gtp": "other0",
150 "ncb1_Internal1_mac": "00:11:22:EF:AC:DF",
151 "sctp-b-src_subnet_prefix_v6": "::",
152 "sctp-a-egress_dst_subnet_prefix_len": "0.0",
153 "int1_sec_group_name": "int1-sec-group",
154 "Internal1_dhcp": "false",
155 "sctp-a-ipv6-egress_dst_end_port": "65535",
156 "Internal2_forwarding_mode": "l2",
157 "fsb2_Internal2_mac": "00:11:22:EF:AC:DF",
158 "sctp-b-egress_dst_subnet_prefix": "0.0.0.0",
159 "Internal1_net_cidr_len": "17",
160 "gpb2_Internal1_mac": "00:11:22:EF:AC:DF",
161 "sctp-b-ingress-src_subnet_prefix_len": "0.0",
162 "sctp-a-ingress_dst_addresses": "local",
163 "sctp-a-egress_action": "pass",
164 "fsb_volume_type_0": "SF-Default-SSD",
165 "ncb2_Internal2_mac": "00:11:22:EF:AC:DF",
166 "vlc_st_interface_type_sctp_a": "left",
167 "vlc_st_interface_type_sctp_b": "right",
168 "sctp-a-src_subnet_prefix_v6": "::",
169 "vlc_st_version": "2",
170 "sctp-b-egress_ethertype": "IPv4",
171 "sctp-a-ingress_rule_application": "any",
172 "gpb1_Internal2_mac": "00:11:22:EF:AC:DF",
173 "instance_ip_family_v6": "v6",
174 "sctp-a-ipv6-egress_src_start_port": "0",
175 "sctp-b-ingress-src_start_port": "0.0",
176 "sctp-b-ingress_dst_addresses": "local",
177 "fsb1_Internal1_mac": "00:11:22:EF:AC:DF",
178 "vlc_st_interface_type_oam": "management",
179 "multi_stage_design": "true",
180 "oam_sec_group_name": "oam-sec-group",
181 "Internal2_net_gateway": "10.0.0.10",
182 "sctp-a-ipv6-ingress-dst_end_port": "65535",
183 "sctp-b-ipv6-egress-dst_start_port": "0",
184 "Internal1_net_gateway": "10.0.0.10",
185 "sctp-b-ipv6-egress_rule_protocol": "any",
186 "gtp_sec_group_name": "gtp-sec-group",
187 "sctp-a-ipv6-egress_dst_subnet_prefix": "0.0.0.0",
188 "sctp-b-ipv6-egress_dst_subnet_prefix_len": "0",
189 "sctp-a-ipv6-ingress_dst_addresses": "local",
190 "sctp-a-egress_rule_protocol": "icmp",
191 "sctp-b-ipv6-egress_action": "pass",
192 "sctp-a-ipv6-egress_action": "pass",
193 "Internal1_shared": "false",
194 "sctp-b-ipv6-ingress_rule_protocol": "any",
195 "Internal2_net_cidr_len": "17",
196 "sctp-a-name": "epc-sctp-a-ipv4v6-sec-group",
197 "sctp-a-ingress-src_end_port": "65535.0",
198 "sctp-b-ipv6-ingress_src_subnet_prefix": "0.0.0.0",
199 "sctp-a-egress-dst_end_port": "65535.0",
200 "sctp-a-ingress_action": "pass",
201 "sctp-b-egress_rule_protocol": "icmp",
202 "sctp-b-ipv6-ingress_action": "pass",
203 "vlc_st_service_type": "firewall",
204 "sctp-b-ipv6-egress_dst_end_port": "65535",
205 "sctp-b-ipv6-ingress-dst_start_port": "0",
206 "vlc2_Internal2_mac": "00:11:22:EF:AC:DF",
207 "vlc_st_availability_zone": "true",
208 "fsb_volume_image_name_1": "MME_FSB2_16ACP04_GA.qcow2",
209 "sctp-b-ingress-src_subnet_prefix": "0.0.0.0",
210 "sctp-a-ipv6-ingress_src_subnet_prefix_len": "0",
211 "Internal1_allow_transit": "true",
212 "gpb_flavor_name": "nv.c20r64d1",
213 "availability_zone_max_count": "1",
214 "fsb_volume_image_name_0": "MME_FSB1_16ACP04_GA.qcow2",
215 "sctp-b-ipv6-ingress_dst_addresses": "local",
216 "sctp-b-ipv6-egress_dst_subnet_prefix": "0.0.0.0",
217 "sctp-b-ipv6-ingress_ethertype": "IPv4",
218 "vlc1_Internal2_mac": "00:11:22:EF:AC:DF",
219 "sctp-a-ingress-src_subnet_prefix": "0.0.0.0",
220 "sctp-a-ipv6-ingress_action": "pass",
221 "Internal1_rpf": "disable",
222 "sctp-b-ingress_ethertype": "IPv4",
223 "sctp-b-egress_rule_application": "any",
224 "sctp-b-ingress-src_end_port": "65535.0",
225 "sctp-a-ipv6-ingress_rule_protocol": "any",
226 "sctp-a-ingress-src_start_port": "0.0",
227 "sctp-b-egress-dst_end_port": "65535.0"
230 "modelCustomizationName": "VF_vGeraldine 0",
232 "vf_vgeraldine0..VfVgeraldine..vflorence_vlc..module-1": {
233 "uuid": "522159d5-d6e0-4c2a-aa44-5a542a12a830",
234 "invariantUuid": "98a7c88b-b577-476a-90e4-e25a5871e02b",
235 "customizationUuid": "55b1be94-671a-403e-a26c-667e9c47d091",
237 "name": "VfVgeraldine..vflorence_vlc..module-1",
239 "modelCustomizationName": "VfVgeraldine..vflorence_vlc..module-1",
241 "minCountInstances": 0,
242 "maxCountInstances": null,
244 "vfModuleLabel": "vflorence_vlc"
247 "volumeGroupAllowed": true
249 "vf_vgeraldine0..VfVgeraldine..vflorence_gpb..module-2": {
250 "uuid": "41708296-e443-4c71-953f-d9a010f059e1",
251 "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9",
252 "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c",
254 "name": "VfVgeraldine..vflorence_gpb..module-2",
256 "modelCustomizationName": "VfVgeraldine..vflorence_gpb..module-2",
258 "minCountInstances": 0,
259 "maxCountInstances": null,
261 "vfModuleLabel": "vflorence_gpb"
264 "volumeGroupAllowed": false
266 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
267 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
268 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
269 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
271 "name": "VfVgeraldine..base_vflorence..module-0",
273 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
275 "minCountInstances": 1,
276 "maxCountInstances": 1,
278 "vfModuleLabel": "base_vflorence"
281 "volumeGroupAllowed": true
285 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
286 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
287 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
288 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
290 "name": "VfVgeraldine..base_vflorence..module-0",
292 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
294 "minCountInstances": 1,
295 "maxCountInstances": 1,
297 "vfModuleLabel": "base_vflorence"
302 "vfcInstanceGroups": {}
307 "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b986",
308 "invariantUuid": "379f816b-a7aa-422f-be30-17114ff50b7c",
309 "description": "ECOMP generic virtual link (network) base type for all other service-level and global networks",
312 "customizationUuid": "94fdd893-4a36-4d70-b16a-ec29c54c184f",
316 "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}}",
317 "exVL_naming": "{ecomp_generated_naming=true}",
318 "network_flows": "{is_network_policy=false, is_bound_to_vpn=false}",
319 "network_homing": "{ecomp_selected_instance_node_target=false}"
322 "modelCustomizationName": "ExtVL 0"
325 "collectionResources": {},
327 "Port Mirroring Configuration By Policy 0": {
328 "uuid": "b4398538-e89d-4f13-b33d-ca323434ba50",
329 "invariantUuid": "6ef0ca40-f366-4897-951f-abd65d25f6f7",
330 "description": "A port mirroring configuration by policy object",
331 "name": "Port Mirroring Configuration By Policy",
333 "customizationUuid": "3c3b7b8d-8669-4b3b-8664-61970041fad2",
337 "type": "Configuration",
338 "modelCustomizationName": "Port Mirroring Configuration By Policy 0",
340 "collectorNodes": null,
341 "configurationByPolicy": false
344 "serviceProxies": {},
346 "vf_vgeraldine0..VfVgeraldine..vflorence_vlc..module-1": {
347 "uuid": "522159d5-d6e0-4c2a-aa44-5a542a12a830",
348 "invariantUuid": "98a7c88b-b577-476a-90e4-e25a5871e02b",
349 "customizationUuid": "55b1be94-671a-403e-a26c-667e9c47d091",
351 "name": "VfVgeraldine..vflorence_vlc..module-1",
353 "modelCustomizationName": "VfVgeraldine..vflorence_vlc..module-1",
355 "minCountInstances": 0,
356 "maxCountInstances": null,
358 "vfModuleLabel": "vflorence_vlc"
361 "volumeGroupAllowed": true
363 "vf_vgeraldine0..VfVgeraldine..vflorence_gpb..module-2": {
364 "uuid": "41708296-e443-4c71-953f-d9a010f059e1",
365 "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9",
366 "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c",
368 "name": "VfVgeraldine..vflorence_gpb..module-2",
370 "modelCustomizationName": "VfVgeraldine..vflorence_gpb..module-2",
372 "minCountInstances": 0,
373 "maxCountInstances": null,
375 "vfModuleLabel": "vflorence_gpb"
378 "volumeGroupAllowed": false
380 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
381 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
382 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
383 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
385 "name": "VfVgeraldine..base_vflorence..module-0",
387 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
389 "minCountInstances": 1,
390 "maxCountInstances": 1,
392 "vfModuleLabel": "base_vflorence"
395 "volumeGroupAllowed": true
399 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
400 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
401 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
402 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
404 "name": "VfVgeraldine..base_vflorence..module-0",
406 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
408 "minCountInstances": 1,
409 "maxCountInstances": 1,
411 "vfModuleLabel": "base_vflorence"
420 "6e59c5de-f052-46fa-aa7e-2fca9d674c44": {
423 "rollbackOnFailure": "true",
425 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
426 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo": {
427 "isMissingData": false,
428 "sdncPreReload": null,
430 "modelType": "VFmodule",
431 "modelInvariantId": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
432 "modelVersionId": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
433 "modelName": "VfVgeraldine..base_vflorence..module-0",
435 "modelCustomizationId": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
436 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0"
441 "trackById": "wmtm6sy2uj"
445 "isMissingData": true,
446 "originalName": "VF_vGeraldine 0",
447 "vnfStoreKey": "VF_vGeraldine 0",
448 "trackById": "p3wk448m5do",
449 "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60",
450 "productFamilyId": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
451 "lcpCloudRegionId": null,
453 "lineOfBusiness": null,
454 "platformName": null,
457 "modelInvariantId": "4160458e-f648-4b30-a176-43881ffffe9e",
458 "modelVersionId": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
459 "modelName": "VF_vGeraldine",
460 "modelVersion": "2.0",
461 "modelCustomizationName": "VF_vGeraldine 0"
468 "validationCounter": 1,
470 "existingVNFCounterMap": {
471 "d6557200-ecf2-4641-8094-5393ae3aae60": 1
473 "globalSubscriberId": "e433710f-9217-458d-a79d-1c7aff376d89",
474 "subscriptionServiceType": "TYLER SILVIA",
475 "owningEntityId": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc",
476 "productFamilyId": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
477 "lcpCloudRegionId": "hvf6",
478 "tenantId": "229bcdc6eaeb4ca59d55221141d01f8e",
481 "rollbackOnFailure": "true",
484 "modelInvariantId": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
485 "modelVersionId": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
486 "modelName": "ComplexService",
487 "modelVersion": "1.0",
488 "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44"
491 "name": "ComplexService",
493 "description": "ComplexService",
494 "category": "Emanuel",
495 "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
496 "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
499 "isMultiStepDesign": false
502 "lcpRegionsAndTenants": {
515 "lcpRegionsTenantsMap": {
518 "id": "092eb9e8e4b7412e8787dd091bc58e86",
519 "name": "USP-SIP-IC-24335-T-01",
525 "id": "bae71557c5bb4d5aac6743a4e5f1d054",
526 "name": "AIN Web Tool-15-D-testalexandria",
530 "id": "d0a3e3f2964542259d155a81c41aadc3",
531 "name": "test-hvf6-09",
535 "id": "fa45ca53c80b492fa8be5477cd84fc2b",
540 "id": "cbb99fe4ada84631b7baf046b6fd2044",
541 "name": "DN5242-Nov16-T3",
549 "id": "ebc3bc3d-62fd-4a3f-a037-f619df4ff034",
554 "id": "17cc1042-527b-11e6-beb8-9e71128cae77",
559 "id": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
564 "id": "a4f6f2ae-9bf5-4ed7-b904-06b2099c4bd7",
565 "name": "Enhanced Services",
574 "id": "323d69d9-2efe-4r45-ay0a-89ea7ard4e6f",
575 "name": "vEsmeralda",
579 "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
584 "id": "d8a6ed93-251c-47ca-adc9-86671fd19f4c",
589 "id": "db171b8f-115c-4992-a2e3-ee04cae357e0",
609 "id": "e433710f-9217-458d-a79d-1c7aff376d89",
610 "name": "TYLER SILVIA",
614 "id": "b6a3f28c-eebf-494c-a900-055cc7c874ce",
624 "id": "0ee8c1bc-7cbd-4b0a-a1ac-e9999255abc1",
625 "name": "CARA Griffin",
629 "id": "c7611ebe-c324-48f1-8085-94aef0c6ef3d",
630 "name": "DARREN MCGEE",
634 "id": "e30755dc-5673-4b6b-9dcf-9abdd96b93d1",
640 "name": "vSalvatore",
644 "id": "d7bb0a21-66f2-4e6d-87d9-9ef3ced63ae4",
654 "id": "12a96a9d-4b4c-4349-a950-fe1159602621",
655 "name": "DARREN MCGEE",
660 "e433710f-9217-458d-a79d-1c7aff376d89": [
663 "name": "vRichardson",
668 "name": "TYLER SILVIA",
683 "name": "vVoiceMail",
718 "name": "vEsmeralda",
748 "name": "JOHANNA_SANTOS",
761 "name": "NFTJSSSS-NFT1"
765 "name": "YUDFJULP-JAG1"
769 "name": "UUUAIAAI-YYY1"
773 "name": "AVTRFLHD-AVT1"
777 "name": "ATLSANAI-ATL34"
780 "categoryParameters": {
781 "owningEntityList": [
787 "id": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc",
788 "name": "WayneHolland"
809 "lineOfBusinessList": [
830 "type": "[LCP_REGIONS_AND_TENANTS] Update",
834 "name": "CAR_2020_ER",
838 "id": "21014aa2-526b-11e6-beb8-9e71128cae77",
839 "name": "JULIO ERICKSON",
843 "id": "DHV1707-TestSubscriber-2",
844 "name": "DALE BRIDGES",
848 "id": "DHV1707-TestSubscriber-1",
849 "name": "LLOYD BRIDGES",
853 "id": "jimmy-example",
854 "name": "JimmyExampleCust-20161102",
858 "id": "jimmy-example2",
859 "name": "JimmyExampleCust-20161103",
863 "id": "ERICA5779-TestSub-PWT-102",
864 "name": "ERICA5779-TestSub-PWT-102",
868 "id": "ERICA5779-TestSub-PWT-101",
869 "name": "ERICA5779-TestSub-PWT-101",
873 "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
878 "id": "ERICA5779-Subscriber-4",
879 "name": "ERICA5779-Subscriber-5",
883 "id": "ERICA5779-TestSub-PWT-103",
884 "name": "ERICA5779-TestSub-PWT-103",
888 "id": "ERICA5779-Subscriber-2",
889 "name": "ERICA5779-Subscriber-2",
893 "id": "e433710f-9217-458d-a79d-1c7aff376d89",
894 "name": "SILVIA ROBBINS",
898 "id": "ERICA5779-Subscriber-3",
899 "name": "ERICA5779-Subscriber-3",
903 "id": "31739f3e-526b-11e6-beb8-9e71128cae77",
904 "name": "CRAIG/ROBERTS",
913 class MockFeatureFlagsService {}
915 describe('VNF Control Generator', () => {
917 let service: VnfControlGenerator;
918 let httpMock: HttpTestingController;
921 beforeAll(done => (async () => {
922 TestBed.configureTestingModule({
923 imports: [HttpClientTestingModule],
924 providers: [VnfControlGenerator,
926 BasicControlGenerator,
930 {provide:FeatureFlagsService, useClass: MockFeatureFlagsService},
931 {provide: NgRedux, useClass: MockAppStore}]
933 await TestBed.compileComponents();
936 injector = getTestBed();
937 service = injector.get(VnfControlGenerator);
938 httpMock = injector.get(HttpTestingController);
940 })().then(done).catch(done.fail));
944 test('should call platform dropdown control', ()=>{
945 spyOn(service, 'getPlatformDropdownControl');
947 service.getPlatformControl(null, [], false);
949 expect(service.getPlatformDropdownControl).toBeCalledWith(null, []);
952 test('should call platform multi select control', ()=>{
953 spyOn(service, 'getPlatformMultiselectControl');
955 service.getPlatformControl(null, [], true);
957 expect(service.getPlatformMultiselectControl).toBeCalledWith(null, []);
960 test('should generate platform multi select control', ()=>{
961 const control = service.getPlatformMultiselectControl(null, []);
962 expect(control.type).toEqual(FormControlType.MULTI_SELECT);
963 expect(control.controlName).toEqual('platformName');
964 expect(control.displayName).toEqual('Platform');
965 expect(control.dataTestId).toEqual('multi-selectPlatform');
966 expect(control.selectedFieldName).toEqual('name');
967 expect(control.value).toEqual('');
968 expect(control.onChange).toBeDefined();
969 expect(control.convertOriginalDataToArray).toBeDefined();
972 test('getMacroFormControls check for mandatory controls', () => {
973 const serviceId : string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
974 const vnfName : string = "VF_vGeraldine 0";
975 const vnfStoreKey : string = "VF_vGeraldine 0";
976 const controls :FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vnfName, []);
978 const mandatoryControls : string[] = [
979 FormControlNames.INSTANCE_NAME,
980 FormControlNames.LCPCLOUD_REGION_ID,
981 FormControlNames.TENANT_ID,
985 for(let i = 0 ; i < mandatoryControls.length ; i++){
986 let requiredExist = controls.find(ctrl => ctrl.controlName === mandatoryControls[i]).validations.find(item => item.validatorName === 'required');
987 expect(requiredExist).toBeDefined();
991 test('should provide empty array on getMacroFormControls when serviceId, vnfName and vnfStoreKey equals to null', () => {
993 let vnfStoreKey = null;
994 const serviceId = null;
995 const vnfName : string = null;
996 const result:FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vnfName, []);
997 expect(result).toEqual([]);
1000 test('should provide empty array on getAlaCarteFormControls when serviceId, vnfName and vnfStoreKey equals to null', () => {
1001 let vnfStoreKey = null;
1002 const serviceId = null;
1003 const vnfName : string = null;
1004 const result:FormControlModel[] = service.getAlaCarteFormControls(serviceId, vnfStoreKey, vnfName, []);
1005 expect(result).toEqual([]);
1008 function getALaCarteFormControls(vnfStoreKey: string): FormControlModel[] {
1009 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
1010 const vnfName: string = "VF_vGeraldine 0";
1011 const controls: FormControlModel[] = service.getAlaCarteFormControls(serviceId, vnfStoreKey, vnfName, []);
1015 test('getMacroFormControls should return the correct order of controls', () => {
1016 const serviceId : string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
1017 const vnfName : string = "VF_vGeraldine 0";
1018 const vnfStoreKey : string = null;
1019 const controls :FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vnfName, []);
1021 const controlsOrderNames = [
1022 FormControlNames.INSTANCE_NAME,
1023 FormControlNames.PRODUCT_FAMILY_ID,
1024 FormControlNames.LCPCLOUD_REGION_ID ,
1030 expect(controls.length).toEqual(7);
1031 for(let i = 0 ; i < controls.length ; i++){
1032 expect(controls[i].controlName).toEqual(controlsOrderNames[i]);
1036 test('getAlacartFormControls should return the correct order of controls', () => {
1037 const controls = getALaCarteFormControls(null);
1039 const controlsOrderNames = [
1040 FormControlNames.INSTANCE_NAME,
1041 FormControlNames.PRODUCT_FAMILY_ID,
1042 FormControlNames.LCPCLOUD_REGION_ID,
1047 'rollbackOnFailure'];
1048 expect(controls.length).toEqual(8);
1049 for(let i = 0 ; i < controls.length ; i++) {
1050 expect(controls[i].controlName).toEqual(controlsOrderNames[i]);
1055 test('getAlacartFormControls check for mandatory controls', () => {
1056 const controls = getALaCarteFormControls("VF_vGeraldine 0");
1057 const mandatoryControls : string[] = [
1058 FormControlNames.INSTANCE_NAME,
1059 FormControlNames.LCPCLOUD_REGION_ID,
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();
1071 test('getAlacartFormControls instance name control validator shall have the expected regex', () => {
1072 const controls:FormControlModel[] = getALaCarteFormControls("VF_vGeraldine 0");
1074 const instanceNameControl: FormControlModel = <FormControlModel>controls.find(item => item.controlName === FormControlNames.INSTANCE_NAME);
1075 const instanceNameValidator: ValidatorModel = instanceNameControl.validations.find(val => val.validatorName === ValidatorOptions.pattern);
1076 expect(instanceNameValidator.validatorArg).toEqual(/^[a-zA-Z0-9._-]*$/);
1079 test('rollback should return observable of true, false', () => {
1080 let result : Observable<SelectOption[]> = service.getRollBackOnFailureOptions();
1081 result.subscribe((val)=>{
1082 expect(val).toEqual([
1083 new SelectOption({id: 'true', name: 'Rollback'}),
1084 new SelectOption({id: 'false', name: 'Don\'t Rollback'})