diff options
author | IBM602-PC0F1E3C\Arundathi <arundpil@in.ibm.com> | 2018-07-16 15:30:37 +0530 |
---|---|---|
committer | Takamune Cho <tc012c@att.com> | 2018-07-16 14:41:33 +0000 |
commit | cf1c531c0f2dd6a5977071c904b3cb9d6cdd0bd7 (patch) | |
tree | dfba5e82102ed76b97303d32cee05455910feaeb /src/app/vnfs/build-artifacts/build-artifacts.component.spec.ts | |
parent | 675e8b8c14dafa82e3e771bfe3fd616e19475766 (diff) |
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 <arundpil@in.ibm.com>
Diffstat (limited to 'src/app/vnfs/build-artifacts/build-artifacts.component.spec.ts')
-rw-r--r-- | src/app/vnfs/build-artifacts/build-artifacts.component.spec.ts | 21 |
1 files changed, 18 insertions, 3 deletions
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(); }); - - }); |