From 24df8b02ff6c40196756c4091260827e900eb66f Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Wed, 4 Sep 2019 15:49:54 +0530 Subject: template-configuration component spec changes Fixed test case in this component Issue-ID: APPC-1632 Change-Id: Ic1a8d4616a0f5abe6bf90fe012b5d1af7456bbf4 Signed-off-by: Arundathi Patil --- .../template-configuration.component.spec.ts | 28 ++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/app/vnfs/build-artifacts/template-holder/template-configuration/template-configuration.component.spec.ts b/src/app/vnfs/build-artifacts/template-holder/template-configuration/template-configuration.component.spec.ts index d96519a..e4c4e42 100644 --- a/src/app/vnfs/build-artifacts/template-holder/template-configuration/template-configuration.component.spec.ts +++ b/src/app/vnfs/build-artifacts/template-holder/template-configuration/template-configuration.component.spec.ts @@ -134,7 +134,7 @@ describe('GoldenConfigurationComponent', () => { }); - fit('validate initialisation of variables in ngOnit() function', inject([MappingEditorService], (mappingEditorService: MappingEditorService) => { + it('validate initialisation of variables in ngOnit() function', inject([MappingEditorService], (mappingEditorService: MappingEditorService) => { fixture = TestBed.createComponent(GoldenConfigurationComponent); component = fixture.componentInstance; mappingEditorService.newObject = { @@ -476,10 +476,34 @@ describe('GoldenConfigurationComponent', () => { // End fileChange method it('should give the correct template artifact name when multiple template identifiers are provided from reference page', inject([MappingEditorService], (mappingEditorService: MappingEditorService) => { + mappingEditorService.newObject = { + "action": "Configure", + "action-level": "vnf", + "scope": { "vnf-type": "testVnf", "vnfc-type": "" }, + "template": "Y", + "vm": [], + "device-protocol": + "CHEF", + "user-name": "", + "port-number": "", + "artifact-list": [{ + "artifact-name": "template_ConfigScaleOut_test_0.0.1V_id1.json", + "artifact-type": "config_template" + }, + { + "artifact-name": "pd_Configure_test_0.0.1V.yaml", + "artifact-type": "parameter_definitions" + }], + "scopeType": "vnf-type", + "vnf": "testVnf", + "vnfc": "", + "protocol": "CHEF", + "template_artifact": "template_ConfigScaleOut_test_0.0.1V_id1.json" + } fixture = TestBed.createComponent(GoldenConfigurationComponent); component = fixture.componentInstance; + fixture.detectChanges(); mappingEditorService.identifier = "id1"; - mappingEditorService.latestAction = { "action": "ConfigScaleOut", "action-level": "vnf", "scope": { "vnf-type": "test", "vnfc-type": "" }, "template": "Y", "vm": [], "device-protocol": "CHEF", "user-name": "", "port-number": "", "artifact-list": [{ "artifact-name": "template_ConfigScaleOut_test_0.0.1V_id1.json", "artifact-type": "config_template" }, { "artifact-name": "pd_ConfigScaleOut_test_0.0.1V_id1.yaml", "artifact-type": "parameter_definitions" }, { "artifact-name": "template_ConfigScaleOut_test_0.0.1V_id2.json", "artifact-type": "config_template" }, { "artifact-name": "pd_ConfigScaleOut_test_0.0.1V_id2.yaml", "artifact-type": "parameter_definitions" }], "template-id-list": ["id1", "id2"], "scopeType": "vnf-type" }; component.ngAfterViewInit(); expect(component.artifactName).toBe("template_ConfigScaleOut_test_0.0.1V_id1.json"); })); -- cgit 1.2.3-korg