From 4e13224fbd288be91e658fd5315e1214289253d5 Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Fri, 31 Aug 2018 21:29:10 +0530 Subject: 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 --- src/app/vnfs/myvnfs/myvnfs.component.spec.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 -- cgit 1.2.3-korg