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>
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 @@
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