aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/vnfs/build-artifacts/build-artifacts.component.spec.ts
diff options
context:
space:
mode:
authorMohamed Asgar Samiulla(ma926a) <ma926a@us.att.com>2018-04-17 15:14:28 +0530
committerMohamed Asgar Samiulla(ma926a) <ma926a@us.att.com>2018-04-17 15:14:54 +0530
commit7f0939f148645d3b47653dbee7fadc341b16c1c2 (patch)
tree8871e8ce9a961bdd29f462e6a12c23660c33f6c2 /src/app/vnfs/build-artifacts/build-artifacts.component.spec.ts
parent05fc71b2f0612509c4da0ad74bf15f7001ea4e34 (diff)
VM data retrieval from APPC for open stack action
VM data retrieval and stopping user not to navigate to PD and template if mandatory fields are missing in reference data. Issue-ID: APPC-853 Change-Id: Id43500579c6d222a2c17a53db9213372afec565f Signed-off-by: Mohamed Asgar Samiulla(ma926a) <ma926a@us.att.com>
Diffstat (limited to 'src/app/vnfs/build-artifacts/build-artifacts.component.spec.ts')
-rw-r--r--src/app/vnfs/build-artifacts/build-artifacts.component.spec.ts29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/app/vnfs/build-artifacts/build-artifacts.component.spec.ts b/src/app/vnfs/build-artifacts/build-artifacts.component.spec.ts
index 16d7029..48edb99 100644
--- a/src/app/vnfs/build-artifacts/build-artifacts.component.spec.ts
+++ b/src/app/vnfs/build-artifacts/build-artifacts.component.spec.ts
@@ -101,4 +101,33 @@ describe('BuildDesignComponent', () => {
expect(component.refDataRequiredFiels).toBeTruthy();
});
+// Test checkRefDataReqFields Method
+ it('Should notify error message if action is not valid', () => {
+ let spy = spyOn(NotificationsService.prototype, 'error');
+ component.refList = {"action": "", "scope": {"vnf-type": "test 1"}, "device-protocol": "ANSIBLE"};
+
+ component.checkRefDataReqFields();
+
+ expect(spy).toHaveBeenCalled();
+ });
+
+ it('Should notify error message if VNF Type is not valid', () => {
+ let spy = spyOn(NotificationsService.prototype, 'error');
+ component.refList = {"action": "Configure", "scope": {"vnf-type": ""}, "device-protocol": "ANSIBLE"};
+
+ component.checkRefDataReqFields();
+
+ expect(spy).toHaveBeenCalled();
+ });
+
+ it('Should notify error message if Device Protocol is not valid', () => {
+ let spy = spyOn(NotificationsService.prototype, 'error');
+ component.refList = {"action": "Configure", "scope": {"vnf-type": "test 1"}, "device-protocol": ""};
+
+ component.checkRefDataReqFields();
+
+ expect(spy).toHaveBeenCalled();
+ });
+
+
});