diff options
author | IBM602-PC0F1E3C\Arundathi <arundpil@in.ibm.com> | 2018-07-13 15:25:51 +0530 |
---|---|---|
committer | Takamune Cho <tc012c@att.com> | 2018-07-16 14:34:01 +0000 |
commit | 07178dd3c0419a15af7e3dd47967621ab8c8bb5f (patch) | |
tree | 57852e5fdf73f0ebccee701b31e48c3d179fe61d /src/app | |
parent | 435e57ff2284e13fb7f9b0a1fae3ca1e0d02ccf8 (diff) |
wrote unit test case for parameter component.
Added unit test cases to cover ngOninit, selectedNavItem and showUpload
methods.
Issue-ID: APPC-1064
Change-Id: I38b885f905a13ca316ee31e5efa6b5bbb74d8506
Signed-off-by: Arundathi <arundpil@in.ibm.com>
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.spec.ts | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.spec.ts b/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.spec.ts index 7e248e3..d539d6a 100644 --- a/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.spec.ts +++ b/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.spec.ts @@ -2,6 +2,8 @@ ============LICENSE_START========================================== =================================================================== Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. + +Copyright (C) 2018 IBM Intellectual Property. All rights reserved. =================================================================== Unless otherwise specified, all software contained herein is licensed @@ -97,6 +99,28 @@ describe('ParameterComponent', () => { expect(component).toBeTruthy(); }); + it('should call ngOnInit...', inject([MappingEditorService, ParamShareService], (mappingEditorService: MappingEditorService, paramShareService:ParamShareService) => { + + mappingEditorService.latestAction = {"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"}; + mappingEditorService.appDataObject = {"value" : ''}; + mappingEditorService.downloadDataObject = {"value": ''}; + mappingEditorService.identifier = "identifier"; + component.ngOnInit(); + + })); + + it('should test selectedNavItem method...', () => { + component.selectedNavItem('item'); + expect(component.item).toEqual('item'); + }); + + it('should set the selectedUploadType value', ()=>{ + let obj = {value : 'type1', display : 'display1'}; + component.uploadTypes = [obj]; + component.showUpload(); + expect(component.selectedUploadType.toString()).toEqual("type1"); + }); + it('should retrieve PD from APPC...', () => { expect(component.getPD()); |