From cf1c531c0f2dd6a5977071c904b3cb9d6cdd0bd7 Mon Sep 17 00:00:00 2001 From: "IBM602-PC0F1E3C\\Arundathi" Date: Mon, 16 Jul 2018 15:30:37 +0530 Subject: Fixed the failng test cases. Fixed the failing test cases for build-artifacts component. 5 of the test cases in build-artifacts component spec were failing with the below errors, 1. No Provider for Notification Service. 2. Cannot read property 'vnf-type' of undefined. Fixed the above errors. The coverage for this component is now 84.78%. Issue-ID: APPC-1064 Change-Id: Ifee45f86ce7093c9783d1f28a313869300bd8e39 Signed-off-by: Arundathi --- .../build-artifacts.component.spec.ts | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/app') diff --git a/src/app/vnfs/build-artifacts/build-artifacts.component.spec.ts b/src/app/vnfs/build-artifacts/build-artifacts.component.spec.ts index 48edb99..a1b4507 100644 --- a/src/app/vnfs/build-artifacts/build-artifacts.component.spec.ts +++ b/src/app/vnfs/build-artifacts/build-artifacts.component.spec.ts @@ -79,6 +79,7 @@ describe('BuildDesignComponent', () => { declarations: [BuildDesignComponent, HomeComponent, TestComponent, HelpComponent, AboutUsComponent, LogoutComponent], schemas: [NO_ERRORS_SCHEMA], imports: [HttpModule, FormsModule, RouterTestingModule.withRoutes(routes)], + providers : [ NotificationsService ] }) .compileComponents(); @@ -95,7 +96,23 @@ describe('BuildDesignComponent', () => { }); it('Should validate getRefData method', () => { - let refData = {"action": "Configure", "vnf-type": "test 1", "device-protocol": "ANSIBLE"}; + let refData = {"action":"Configure", + "action-level":"vnf", + "scope": { + "vnf-type":"ticktack", + "vnfc-type":"" + }, + "template":"Y", + "vm":[], + "device-protocol":"CHEF", + "user-name":"", + "port-number":"", + "artifact-list":[ + {"artifact-name":"template_Configure_ticktack_0.0.1V.json","artifact-type":"config_template"}, + {"artifact-name":"pd_Configure_ticktack_0.0.1V.yaml","artifact-type":"parameter_definitions"}], + "scopeType":"vnf-type" + }; + component.refDataRequiredFiels = false; component.getRefData(refData); expect(component.refDataRequiredFiels).toBeTruthy(); @@ -128,6 +145,4 @@ describe('BuildDesignComponent', () => { expect(spy).toHaveBeenCalled(); }); - - }); -- cgit 1.2.3-korg