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 {BasicControlGenerator} from "../basic.control.generator";
5 import {AaiService} from "../../../../services/aaiService/aai.service";
6 import {GenericFormService} from "../../generic-form.service";
7 import {FormBuilder} from "@angular/forms";
8 import {LogService} from "../../../../utils/log/log.service";
13 } from "../../../../models/formControlModels/formControl.model";
14 import {FormControlNames, VfModuleControlGenerator} from "./vfModule.control.generator";
15 import {FeatureFlagsService} from "../../../../services/featureFlag/feature-flags.service";
16 import {VfModuleInstance} from "../../../../models/vfModuleInstance";
17 import {VfModule} from "../../../../models/vfModule";
19 class MockAppStore<T> {
25 "FLAG_NETWORK_TO_ASYNC_INSTANTIATION": false,
26 "FLAG_SHOW_ASSIGNMENTS": true,
27 "FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS": true,
28 "FLAG_SHOW_VERIFY_SERVICE": false,
29 "FLAG_SERVICE_MODEL_CACHE": true,
30 "FLAG_SETTING_DEFAULTS_IN_DRAWING_BOARD": false,
31 "FLAG_ADD_MSO_TESTAPI_FIELD": true
33 "type": "[FLAGS] Update"
37 "6e59c5de-f052-46fa-aa7e-2fca9d674c44": {
39 "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
40 "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
41 "name": "ComplexService",
43 "toscaModelURL": null,
44 "category": "Emanuel",
47 "description": "ComplexService",
48 "serviceEcompNaming": "false",
49 "instantiationType": "Macro",
54 "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60",
55 "invariantUuid": "4160458e-f648-4b30-a176-43881ffffe9e",
56 "description": "VSP_vGeraldine",
57 "name": "VF_vGeraldine",
59 "customizationUuid": "91415b44-753d-494c-926a-456a9172bbb9",
62 "serviceEcompNaming" : "true",
64 "ecomp_generated_naming": "false",
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 "sctp-a-IPv6_ethertype": "IPv6",
121 "vlc2_Internal1_mac": "00:11:22:EF:AC:DF",
122 "vlc_st_virtualization_type": "virtual-machine",
123 "sctp-b-ingress-dst_start_port": "0.0",
124 "sctp-b-ingress-dst_end_port": "65535.0",
125 "sctp-a-ipv6-ingress-src_end_port": "65535.0",
126 "sctp-a-display_name": "epc-sctp-a-ipv4v6-sec-group",
127 "sctp-b-ingress_rule_application": "any",
128 "int2_sec_group_name": "int2-sec-group",
129 "vlc_flavor_name": "nd.c16r64d1",
130 "sctp-b-ipv6-egress_src_addresses": "local",
131 "vlc_st_interface_type_int1": "other1",
132 "sctp-b-egress-src_end_port": "65535.0",
133 "sctp-a-ipv6-egress-dst_start_port": "0",
134 "vlc_st_interface_type_int2": "other2",
135 "sctp-a-ipv6-egress_rule_protocol": "any",
136 "Internal2_shared": "false",
137 "sctp-a-ipv6-egress_dst_subnet_prefix_len": "0",
138 "Internal2_rpf": "disable",
139 "vlc1_Internal1_mac": "00:11:22:EF:AC:DF",
140 "sctp-b-ipv6-egress_src_end_port": "65535",
141 "sctp-a-ipv6-egress_src_addresses": "local",
142 "sctp-a-ingress-dst_end_port": "65535.0",
143 "sctp-a-ipv6-egress_src_end_port": "65535",
144 "Internal1_forwarding_mode": "l2",
145 "Internal2_dhcp": "false",
146 "sctp-a-dst_subnet_prefix_v6": "::",
147 "pxe_image_name": "MME_PXE-Boot_16ACP04_GA.qcow2",
148 "vlc_st_interface_type_gtp": "other0",
149 "ncb1_Internal1_mac": "00:11:22:EF:AC:DF",
150 "sctp-b-src_subnet_prefix_v6": "::",
151 "sctp-a-egress_dst_subnet_prefix_len": "0.0",
152 "int1_sec_group_name": "int1-sec-group",
153 "Internal1_dhcp": "false",
154 "sctp-a-ipv6-egress_dst_end_port": "65535",
155 "Internal2_forwarding_mode": "l2",
156 "fsb2_Internal2_mac": "00:11:22:EF:AC:DF",
157 "sctp-b-egress_dst_subnet_prefix": "0.0.0.0",
158 "Internal1_net_cidr_len": "17",
159 "gpb2_Internal1_mac": "00:11:22:EF:AC:DF",
160 "sctp-b-ingress-src_subnet_prefix_len": "0.0",
161 "sctp-a-ingress_dst_addresses": "local",
162 "sctp-a-egress_action": "pass",
163 "fsb_volume_type_0": "SF-Default-SSD",
164 "ncb2_Internal2_mac": "00:11:22:EF:AC:DF",
165 "vlc_st_interface_type_sctp_a": "left",
166 "vlc_st_interface_type_sctp_b": "right",
167 "sctp-a-src_subnet_prefix_v6": "::",
168 "vlc_st_version": "2",
169 "sctp-b-egress_ethertype": "IPv4",
170 "sctp-a-ingress_rule_application": "any",
171 "gpb1_Internal2_mac": "00:11:22:EF:AC:DF",
172 "instance_ip_family_v6": "v6",
173 "sctp-a-ipv6-egress_src_start_port": "0",
174 "sctp-b-ingress-src_start_port": "0.0",
175 "sctp-b-ingress_dst_addresses": "local",
176 "fsb1_Internal1_mac": "00:11:22:EF:AC:DF",
177 "vlc_st_interface_type_oam": "management",
178 "multi_stage_design": "true",
179 "oam_sec_group_name": "oam-sec-group",
180 "Internal2_net_gateway": "10.0.0.10",
181 "sctp-a-ipv6-ingress-dst_end_port": "65535",
182 "sctp-b-ipv6-egress-dst_start_port": "0",
183 "Internal1_net_gateway": "10.0.0.10",
184 "sctp-b-ipv6-egress_rule_protocol": "any",
185 "gtp_sec_group_name": "gtp-sec-group",
186 "sctp-a-ipv6-egress_dst_subnet_prefix": "0.0.0.0",
187 "sctp-b-ipv6-egress_dst_subnet_prefix_len": "0",
188 "sctp-a-ipv6-ingress_dst_addresses": "local",
189 "sctp-a-egress_rule_protocol": "icmp",
190 "sctp-b-ipv6-egress_action": "pass",
191 "sctp-a-ipv6-egress_action": "pass",
192 "Internal1_shared": "false",
193 "sctp-b-ipv6-ingress_rule_protocol": "any",
194 "Internal2_net_cidr_len": "17",
195 "sctp-a-name": "epc-sctp-a-ipv4v6-sec-group",
196 "sctp-a-ingress-src_end_port": "65535.0",
197 "sctp-b-ipv6-ingress_src_subnet_prefix": "0.0.0.0",
198 "sctp-a-egress-dst_end_port": "65535.0",
199 "sctp-a-ingress_action": "pass",
200 "sctp-b-egress_rule_protocol": "icmp",
201 "sctp-b-ipv6-ingress_action": "pass",
202 "vlc_st_service_type": "firewall",
203 "sctp-b-ipv6-egress_dst_end_port": "65535",
204 "sctp-b-ipv6-ingress-dst_start_port": "0",
205 "vlc2_Internal2_mac": "00:11:22:EF:AC:DF",
206 "vlc_st_availability_zone": "true",
207 "fsb_volume_image_name_1": "MME_FSB2_16ACP04_GA.qcow2",
208 "sctp-b-ingress-src_subnet_prefix": "0.0.0.0",
209 "sctp-a-ipv6-ingress_src_subnet_prefix_len": "0",
210 "Internal1_allow_transit": "true",
211 "gpb_flavor_name": "nv.c20r64d1",
212 "availability_zone_max_count": "1",
213 "fsb_volume_image_name_0": "MME_FSB1_16ACP04_GA.qcow2",
214 "sctp-b-ipv6-ingress_dst_addresses": "local",
215 "sctp-b-ipv6-egress_dst_subnet_prefix": "0.0.0.0",
216 "sctp-b-ipv6-ingress_ethertype": "IPv4",
217 "vlc1_Internal2_mac": "00:11:22:EF:AC:DF",
218 "sctp-a-ingress-src_subnet_prefix": "0.0.0.0",
219 "sctp-a-ipv6-ingress_action": "pass",
220 "Internal1_rpf": "disable",
221 "sctp-b-ingress_ethertype": "IPv4",
222 "sctp-b-egress_rule_application": "any",
223 "sctp-b-ingress-src_end_port": "65535.0",
224 "sctp-a-ipv6-ingress_rule_protocol": "any",
225 "sctp-a-ingress-src_start_port": "0.0",
226 "sctp-b-egress-dst_end_port": "65535.0"
229 "modelCustomizationName": "VF_vGeraldine 0",
231 "vf_vgeraldine0..VfVgeraldine..vflorence_vlc..module-1": {
232 "uuid": "522159d5-d6e0-4c2a-aa44-5a542a12a830",
233 "invariantUuid": "98a7c88b-b577-476a-90e4-e25a5871e02b",
234 "customizationUuid": "55b1be94-671a-403e-a26c-667e9c47d091",
236 "name": "VfVgeraldine..vflorence_vlc..module-1",
238 "modelCustomizationName": "VfVgeraldine..vflorence_vlc..module-1",
240 "minCountInstances": 0,
241 "maxCountInstances": null,
243 "vfModuleLabel": "vflorence_vlc"
246 "volumeGroupAllowed": true
248 "vf_vgeraldine0..VfVgeraldine..vflorence_gpb..module-2": {
249 "uuid": "41708296-e443-4c71-953f-d9a010f059e1",
250 "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9",
251 "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c",
253 "name": "VfVgeraldine..vflorence_gpb..module-2",
255 "modelCustomizationName": "VfVgeraldine..vflorence_gpb..module-2",
257 "minCountInstances": 0,
258 "maxCountInstances": null,
260 "vfModuleLabel": "vflorence_gpb"
263 "volumeGroupAllowed": false
265 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
266 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
267 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
268 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
270 "name": "VfVgeraldine..base_vflorence..module-0",
272 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
274 "minCountInstances": 1,
275 "maxCountInstances": 1,
277 "vfModuleLabel": "base_vflorence"
280 "volumeGroupAllowed": true
284 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
285 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
286 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
287 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
289 "name": "VfVgeraldine..base_vflorence..module-0",
291 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
293 "minCountInstances": 1,
294 "maxCountInstances": 1,
296 "vfModuleLabel": "base_vflorence"
301 "vfcInstanceGroups": {}
306 "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b986",
307 "invariantUuid": "379f816b-a7aa-422f-be30-17114ff50b7c",
308 "description": "ECOMP generic virtual link (network) base type for all other service-level and global networks",
311 "customizationUuid": "94fdd893-4a36-4d70-b16a-ec29c54c184f",
315 "ecomp_generated_naming": "false",
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": {
424 "rollbackOnFailure": "true",
426 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
427 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo": {
428 "isMissingData": false,
429 "sdncPreReload": null,
431 "modelType": "VFmodule",
432 "modelInvariantId": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
433 "modelVersionId": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
434 "modelName": "VfVgeraldine..base_vflorence..module-0",
436 "modelCustomizationId": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
437 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0"
442 "trackById": "wmtm6sy2uj"
446 "isMissingData": true,
447 "originalName": "VF_vGeraldine 0",
448 "vnfStoreKey": "VF_vGeraldine 0",
449 "trackById": "p3wk448m5do",
450 "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60",
451 "productFamilyId": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
452 "lcpCloudRegionId": null,
454 "lineOfBusiness": null,
455 "platformName": null,
458 "modelInvariantId": "4160458e-f648-4b30-a176-43881ffffe9e",
459 "modelVersionId": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
460 "modelName": "VF_vGeraldine",
461 "modelVersion": "2.0",
462 "modelCustomizationName": "VF_vGeraldine 0"
469 "validationCounter": 1,
471 "existingVNFCounterMap": {
472 "d6557200-ecf2-4641-8094-5393ae3aae60": 1
474 "globalSubscriberId": "e433710f-9217-458d-a79d-1c7aff376d89",
475 "subscriptionServiceType": "TYLER SILVIA",
476 "owningEntityId": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc",
477 "productFamilyId": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
478 "lcpCloudRegionId": "hvf6",
479 "tenantId": "229bcdc6eaeb4ca59d55221141d01f8e",
482 "rollbackOnFailure": "true",
485 "modelInvariantId": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
486 "modelVersionId": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
487 "modelName": "ComplexService",
488 "modelVersion": "1.0",
489 "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44"
492 "name": "ComplexService",
494 "description": "ComplexService",
495 "category": "Emanuel",
496 "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
497 "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
500 "isEcompGeneratedNaming": true,
501 "isMultiStepDesign": false
504 "lcpRegionsAndTenants": {
517 "lcpRegionsTenantsMap": {
520 "id": "092eb9e8e4b7412e8787dd091bc58e86",
521 "name": "USP-SIP-IC-24335-T-01",
527 "id": "bae71557c5bb4d5aac6743a4e5f1d054",
528 "name": "AIN Web Tool-15-D-testalexandria",
532 "id": "d0a3e3f2964542259d155a81c41aadc3",
533 "name": "test-hvf6-09",
537 "id": "fa45ca53c80b492fa8be5477cd84fc2b",
542 "id": "cbb99fe4ada84631b7baf046b6fd2044",
543 "name": "DN5242-Nov16-T3",
551 "id": "ebc3bc3d-62fd-4a3f-a037-f619df4ff034",
556 "id": "17cc1042-527b-11e6-beb8-9e71128cae77",
561 "id": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
566 "id": "a4f6f2ae-9bf5-4ed7-b904-06b2099c4bd7",
567 "name": "Enhanced Services",
576 "id": "323d69d9-2efe-4r45-ay0a-89ea7ard4e6f",
577 "name": "vEsmeralda",
581 "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
586 "id": "d8a6ed93-251c-47ca-adc9-86671fd19f4c",
591 "id": "db171b8f-115c-4992-a2e3-ee04cae357e0",
611 "id": "e433710f-9217-458d-a79d-1c7aff376d89",
612 "name": "TYLER SILVIA",
616 "id": "b6a3f28c-eebf-494c-a900-055cc7c874ce",
626 "id": "0ee8c1bc-7cbd-4b0a-a1ac-e9999255abc1",
627 "name": "CARA Griffin",
631 "id": "c7611ebe-c324-48f1-8085-94aef0c6ef3d",
632 "name": "DARREN MCGEE",
636 "id": "e30755dc-5673-4b6b-9dcf-9abdd96b93d1",
642 "name": "vSalvatore",
646 "id": "d7bb0a21-66f2-4e6d-87d9-9ef3ced63ae4",
656 "id": "12a96a9d-4b4c-4349-a950-fe1159602621",
657 "name": "DARREN MCGEE",
662 "e433710f-9217-458d-a79d-1c7aff376d89": [
665 "name": "vRichardson",
670 "name": "TYLER SILVIA",
685 "name": "vVoiceMail",
720 "name": "vEsmeralda",
750 "name": "JOHANNA_SANTOS",
763 "name": "NFTJSSSS-NFT1"
767 "name": "YUDFJULP-JAG1"
771 "name": "UUUAIAAI-YYY1"
775 "name": "AVTRFLHD-AVT1"
779 "name": "ATLSANAI-ATL34"
782 "categoryParameters": {
783 "owningEntityList": [
789 "id": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc",
790 "name": "WayneHolland"
811 "lineOfBusinessList": [
832 "type": "[LCP_REGIONS_AND_TENANTS] Update",
836 "name": "CAR_2020_ER",
840 "id": "21014aa2-526b-11e6-beb8-9e71128cae77",
841 "name": "JULIO ERICKSON",
845 "id": "DHV1707-TestSubscriber-2",
846 "name": "DALE BRIDGES",
850 "id": "DHV1707-TestSubscriber-1",
851 "name": "LLOYD BRIDGES",
855 "id": "jimmy-example",
856 "name": "JimmyExampleCust-20161102",
860 "id": "jimmy-example2",
861 "name": "JimmyExampleCust-20161103",
865 "id": "ERICA5779-TestSub-PWT-102",
866 "name": "ERICA5779-TestSub-PWT-102",
870 "id": "ERICA5779-TestSub-PWT-101",
871 "name": "ERICA5779-TestSub-PWT-101",
875 "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
880 "id": "ERICA5779-Subscriber-4",
881 "name": "ERICA5779-Subscriber-5",
885 "id": "ERICA5779-TestSub-PWT-103",
886 "name": "ERICA5779-TestSub-PWT-103",
890 "id": "ERICA5779-Subscriber-2",
891 "name": "ERICA5779-Subscriber-2",
895 "id": "e433710f-9217-458d-a79d-1c7aff376d89",
896 "name": "SILVIA ROBBINS",
900 "id": "ERICA5779-Subscriber-3",
901 "name": "ERICA5779-Subscriber-3",
905 "id": "31739f3e-526b-11e6-beb8-9e71128cae77",
906 "name": "CRAIG/ROBERTS",
915 class MockFeatureFlagsService {}
917 describe('VFModule Control Generator', () => {
919 let service: VfModuleControlGenerator;
920 let httpMock: HttpTestingController;
922 beforeAll(done => (async () => {
923 TestBed.configureTestingModule({
924 imports: [HttpClientTestingModule],
925 providers: [VfModuleControlGenerator,
927 BasicControlGenerator,
931 {provide:FeatureFlagsService, useClass: MockFeatureFlagsService},
932 {provide: NgRedux, useClass: MockAppStore}]
934 await TestBed.compileComponents();
936 injector = getTestBed();
937 service = injector.get(VfModuleControlGenerator);
938 httpMock = injector.get(HttpTestingController);
939 jest.spyOn(console, 'error');
941 })().then(done).catch(done.fail));
943 test(' getMacroFormControls gets vnfStoreKey === null', () => {
944 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
945 const vnfStoreKey: string = null;
946 const vfModuleStoreKey: string = 'vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0';
947 const vfModuleUUID: string = "522159d5-d6e0-4c2a-aa44-5a542a12a830";
948 const controls: FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vfModuleStoreKey, vfModuleUUID, true);
950 expect(controls).toEqual([]);
951 expect(console.error).toHaveBeenCalled();
954 test('getAlaCarteFormControls check for mandatory controls', () => {
955 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
956 const vnfStoreKey: string = 'VF_vGeraldine 0';
957 const vfModuleStoreKey: string = 'vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0';
958 const uuidData: Object = {
959 modelId : "522159d5-d6e0-4c2a-aa44-5a542a12a830",
960 modelName : "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0",
961 serviceId : "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
963 vFModuleStoreKey : "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo",
964 vnfStoreKey : "VF_vGeraldine 0"
966 const controls: FormControlModel[] = service.getAlaCarteFormControls(serviceId, vnfStoreKey, vfModuleStoreKey, uuidData, true);
968 const mandatoryControls : string[] = [
969 FormControlNames.INSTANCE_NAME,
970 FormControlNames.LCPCLOUD_REGION_ID,
971 FormControlNames.TENANT_ID,
972 FormControlNames.ROLLBACK_ON_FAILURE,
975 for(let i = 0 ; i < mandatoryControls.length ; i++) {
976 let requiredExist = controls.find(ctrl => ctrl.controlName === mandatoryControls[i]).validations.find(item => item.validatorName === 'required');
977 expect(requiredExist).toBeDefined();
983 [true, true, true, null, true, true],
984 [true, true, false, null, true, false], //Scenario to check that UI field doesn't appear.
985 [false, true, false, "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0_vol", true, true],
986 [false, true, true, "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0_vol", true, true],
987 [false, false, true, null, false, false],
990 test.each(cases)('Given Ecomp Gen Name: %p and VG Name %p , ' +
991 'is A La Carte %p - expect the name value for VG to be %p , ' +
992 'VG Name should be defined: %p , and should the field be visible: %p',
993 (ecomGenName, vGName, isALaCarte, expectedName, shouldWeVerifyDefinitionOfField, isVisible) => {
994 const moduleName = "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0";
995 service.vfModuleModel = new VfModule();
996 service.vfModuleModel.name = moduleName;
997 service.vfModuleModel.volumeGroupAllowed = vGName;
998 let vnf : Object = {isEcompGeneratedNaming: ecomGenName};
999 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
1000 const vnfStoreKey: string = 'VF_vGeraldine 0';
1001 const uuidData: Object = {
1002 modelName : moduleName,
1003 vFModuleStoreKey : "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo",
1005 const vfModuleModel :VfModuleInstance = service.getVfModuleInstance(serviceId, vnfStoreKey, uuidData,true);
1006 let existingMatchingFieldInForm = buildVfModuleFormControlModel(vfModuleModel ,serviceId, vnf, isALaCarte);
1007 if (shouldWeVerifyDefinitionOfField) {
1008 expect(existingMatchingFieldInForm).toBeDefined();
1009 expect(existingMatchingFieldInForm.value).toEqual(expectedName);
1010 expect(existingMatchingFieldInForm.isVisible).toEqual(isVisible);
1012 expect(existingMatchingFieldInForm).toBeUndefined();
1016 let buildVfModuleFormControlModel = function(vfModuleModel :any, serviceId: string, vnf, isALaCarte) :FormControlModel {
1017 let controls: FormControlModel[] = service.pushInstanceAndVGToForm([], vfModuleModel, serviceId, vnf, isALaCarte);
1018 return controls.find(ctrl => ctrl.controlName === FormControlNames.VOLUME_GROUP_NAME);
1021 test('getMacroFormControls check for mandatory controls', () => {
1022 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
1023 const vnfStoreKey: string = 'VF_vGeraldine 0';
1024 const uuidData: Object = {
1025 modelId : "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
1026 modelName : "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0",
1027 serviceId : "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
1029 vFModuleStoreKey : "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo",
1030 vnfStoreKey : "VF_vGeraldine 0"
1032 const controls: FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vnfStoreKey, uuidData, true);
1034 const mandatoryControls : string[] = [
1038 for(let i = 0 ; i < mandatoryControls.length ; i++) {
1039 let requiredExist = controls.find(ctrl => ctrl.controlName === mandatoryControls[i]).validations.find(item => item.validatorName === 'required');
1040 expect(requiredExist).toBeDefined();
1044 test(' getMacroFormControls gets null vnfStoreKey', () => {
1045 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
1046 const vnfStoreKey: string = null;
1047 const vfModuleUUID: string = "522159d5-d6e0-4c2a-aa44-5a542a12a830";
1048 const uuidData: Object = {};
1049 const controls: FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vfModuleUUID, uuidData,true);
1051 expect(controls).toEqual([]);
1052 expect(console.error).toHaveBeenCalled();
1055 test('getAlaCarteFormControls should return the correct order of controls', () => {
1056 const controls:FormControlModel[] = getAlaCarteFormControls();
1058 const orderedControls : string[] = [
1059 FormControlNames.INSTANCE_NAME,
1060 FormControlNames.VOLUME_GROUP_NAME,
1061 FormControlNames.LCPCLOUD_REGION_ID,
1062 FormControlNames.LEGACY_REGION,
1063 FormControlNames.TENANT_ID,
1064 FormControlNames.ROLLBACK_ON_FAILURE,
1065 FormControlNames.SDN_C_PRE_LOAD
1068 expect(controls.length).toEqual(7);
1069 for(let i = 0 ; i < orderedControls.length ; i++) {
1070 expect(controls[i].controlName).toEqual(orderedControls[i]);
1074 function getAlaCarteFormControls():FormControlModel[] {
1075 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
1076 const vnfStoreKey: string = 'VF_vGeraldine 0';
1077 const vfModuleUUID: string = "522159d5-d6e0-4c2a-aa44-5a542a12a830";
1078 const uuidData: Object = {
1079 modelId: "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
1080 modelName: "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0",
1081 serviceId: "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
1083 vFModuleStoreKey: "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo",
1084 vnfStoreKey: "VF_vGeraldine 0"
1086 const controls: FormControlModel[] = service.getAlaCarteFormControls(serviceId, vnfStoreKey, vfModuleUUID, uuidData, true);
1090 test('getAlaCarteFormControls responce with wrong order of controls', () => {
1091 const controls:FormControlModel[] = getAlaCarteFormControls();
1093 const orderedControls : string[] = [
1094 FormControlNames.INSTANCE_NAME,
1095 FormControlNames.VOLUME_GROUP_NAME,
1096 FormControlNames.LCPCLOUD_REGION_ID,
1097 FormControlNames.TENANT_ID, // TENANT_ID must be after LEGACY_REGION
1098 FormControlNames.LEGACY_REGION,
1099 FormControlNames.ROLLBACK_ON_FAILURE,
1100 FormControlNames.SDN_C_PRE_LOAD
1103 for(let i = 0 ; i < orderedControls.length ; i++) {
1104 if (controls[i].controlName === 'legacyRegion') {
1105 expect(orderedControls[i]).toEqual('tenantId');
1110 test('getMacroFormControls should return the correct order of controls', () => {
1111 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
1112 const vnfStoreKey: string = 'VF_vGeraldine 0';
1113 const vfModuleUUID: string = "522159d5-d6e0-4c2a-aa44-5a542a12a830";
1114 const uuidData: Object = {
1115 modelId : "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
1116 modelName : "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0",
1117 serviceId : "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
1119 vFModuleStoreKey : "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo",
1120 vnfStoreKey : "VF_vGeraldine 0"
1122 const controls: FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vfModuleUUID, uuidData, true);
1124 const orderedControls : string[] = [
1125 FormControlNames.INSTANCE_NAME,
1126 FormControlNames.VOLUME_GROUP_NAME
1129 for(let i = 0 ; i < orderedControls.length ; i++) {
1130 expect(controls[i].controlName).toEqual(orderedControls[i]);
1137 ${'volumeGroupName'}
1138 `('getAlacartFormControls $controllerName control validator shall have the expected regex', ({controllerName}) => {
1139 const controls:FormControlModel[] = getAlaCarteFormControls();
1141 const instanceNameControl: FormControlModel = <FormControlModel>controls.find(item => item.controlName == controllerName);
1142 const instanceNameValidator: ValidatorModel = instanceNameControl.validations.find(val => val.validatorName === ValidatorOptions.pattern);
1143 expect(instanceNameValidator.validatorArg).toEqual(/^[a-zA-Z0-9._-]*$/);
1146 test(' getAlaCarteFormControls gets null service', () => {
1147 const controls:FormControlModel[] = getAlaCarteFormControls();
1148 expect(controls.length).toEqual(7);
1150 const orderedControls : string[] = [
1151 FormControlNames.INSTANCE_NAME,
1152 FormControlNames.VOLUME_GROUP_NAME,
1153 FormControlNames.LCPCLOUD_REGION_ID,
1154 FormControlNames.LEGACY_REGION,
1155 FormControlNames.TENANT_ID,
1156 FormControlNames.ROLLBACK_ON_FAILURE,
1157 FormControlNames.SDN_C_PRE_LOAD
1160 for(let i = 0 ; i < orderedControls.length ; i++) {
1161 expect(controls[i].controlName).toEqual(orderedControls[i]);