diff options
author | Arundathi Patil <arundpil@in.ibm.com> | 2018-09-12 13:44:56 +0530 |
---|---|---|
committer | Takamune Cho <tc012c@att.com> | 2018-09-16 11:15:48 +0000 |
commit | 2e247cfb288c0c8fcca6e0ab444af663b753cf79 (patch) | |
tree | b72073b3b4643e18c59047f5eae0d5c6a228acf6 /src/app | |
parent | 35011e9af54701ec1842aaa83984781214f2f92a (diff) |
reference-dataform.component- added test case
wrote test case to test and cover validateDataAndSaveToAppc() function
Issue-ID: APPC-1064
Change-Id: I35651401b8065284b7616e8519095d259c170f93
Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.spec.ts | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.spec.ts b/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.spec.ts index 499de2a..fa8ed1a 100644 --- a/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.spec.ts +++ b/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.spec.ts @@ -1128,6 +1128,28 @@ describe('ReferenceDataformComponent', () => { expect(component.vnfcIdentifier).toBe(true); })); + it('should test validateDataAndSaveToAppc function', ()=>{ + component.tempAllData = [{ + action: "Configure", + scope: { + 'vnf-type': "testVnf" + } + },{ + action: "StartApplication", + scope: { + 'vnf-type': "testVnf" + } + } + ]; + component.actionChanged = true; + component.currentAction = 'Config'; + let spy = spyOn(ReferenceDataformComponent.prototype, 'populateExistinAction'); + component.validateDataAndSaveToAppc(true, {}, {}); + expect(spy).toHaveBeenCalled(); + expect(component.referenceDataObject.action).toBe('Config') + }); + + // afterEach(function() { // jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout; // }); |