aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorArundathi Patil <arundpil@in.ibm.com>2018-08-31 21:29:10 +0530
committerTakamune Cho <tc012c@att.com>2018-08-31 23:01:10 +0000
commit4e13224fbd288be91e658fd5315e1214289253d5 (patch)
tree18a9f6ff907ab32453b51dacd5334139ce5d86b4 /src
parentf59bdd9c64e34099137182e7ccc5cd6ed20cd78a (diff)
myvnfs.component.spec- added test cases
Added test cases to cover the new changes in method buildNewDesign() function Issue-ID: APPC-1064 Change-Id: Icd4e48509b64c40a77f893fa5ca9490605878b2a Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/app/vnfs/myvnfs/myvnfs.component.spec.ts18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/app/vnfs/myvnfs/myvnfs.component.spec.ts b/src/app/vnfs/myvnfs/myvnfs.component.spec.ts
index 5220931..0e1d1ff 100644
--- a/src/app/vnfs/myvnfs/myvnfs.component.spec.ts
+++ b/src/app/vnfs/myvnfs/myvnfs.component.spec.ts
@@ -203,4 +203,22 @@ describe('MyvnfsComponent', () => {
expect(component.errorMessage).toBe('');
expect(component.invalid).toBe(false);
});
+
+ it('should test buildNewDesign method with respons yes', ()=> {
+ component.vnfType = 'ABC';
+ component.vnfcRequired = true;
+ component.buildNewDesign('yes');
+ let vnfparams = sessionStorage.getItem('vnfParams');
+ let vnfcSelectionFlag = sessionStorage.getItem('vnfcSelectionFlag');
+ expect(vnfparams).toBe('{"vnfType":"ABC"}');
+ expect(vnfcSelectionFlag).toBe("true");
+ });
+
+ it('should test buildNewDesign method with response other than yes', ()=> {
+ component.vnfType = 'ABC';
+ component.vnfcRequired = true;
+ component.buildNewDesign('No');
+ let vnfparams = sessionStorage.getItem('vnfParams');
+ expect(vnfparams).toBe("");
+ });
}); \ No newline at end of file