myvnfs.component.spec- added test cases 25/64025/2
authorArundathi Patil <arundpil@in.ibm.com>
Fri, 31 Aug 2018 15:59:10 +0000 (21:29 +0530)
committerTakamune Cho <tc012c@att.com>
Fri, 31 Aug 2018 23:01:10 +0000 (23:01 +0000)
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>
src/app/vnfs/myvnfs/myvnfs.component.spec.ts

index 5220931..0e1d1ff 100644 (file)
@@ -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