build-artifacts component : added test case 99/59399/2
authorArundathi Patil <arundpil@in.ibm.com>
Tue, 7 Aug 2018 09:54:52 +0000 (15:24 +0530)
committerTakamune Cho <tc012c@att.com>
Tue, 7 Aug 2018 15:15:36 +0000 (15:15 +0000)
wrote test case to test checkRefDataReqFields() function to notify error
message when no valid template identifier is selected.

Issue-ID: APPC-1064
Change-Id: I083abfd29aac325938116c5acc604e737a0d09ae
Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
src/app/vnfs/build-artifacts/build-artifacts.component.spec.ts

index a6ba8c3..25365bb 100644 (file)
@@ -159,4 +159,13 @@ describe('BuildDesignComponent', () => {
         component.updateAccessUpdatePages('config', [{'action' : 'configModify'}]);
         expect(component.setAllowOtherUpdates).toHaveBeenCalledWith(false);
     });
+
+    it('Should notify error message if no valid template identifier', () => {
+        let spy = spyOn(NotificationsService.prototype, 'error');
+        component.refList = {"action": "ConfigScaleOut", "scope": {"vnf-type": "test 1"}, "device-protocol": ""};
+
+        component.checkRefDataReqFields();
+
+        expect(spy).toHaveBeenCalled();
+    });
 });