reference-dataform.component.spec- fixed test case 17/64317/2
authorArundathi Patil <arundpil@in.ibm.com>
Tue, 4 Sep 2018 06:12:00 +0000 (11:42 +0530)
committerTakamune Cho <tc012c@att.com>
Tue, 4 Sep 2018 19:07:29 +0000 (19:07 +0000)
Fixed few of the errors which caused test case failures

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

index 77f1778..bef89e5 100644 (file)
@@ -204,7 +204,8 @@ describe('ReferenceDataformComponent', () => {
             'user-name': '',
             'port-number': '',
             'artifact-list': []
-        }
+        };
+        component.vnfcIdentifier = '346';
         component.prepareReferenceObject();
         expect(component.referenceDataObject['action-level']).toBe("vnf")
     })
@@ -225,7 +226,7 @@ describe('ReferenceDataformComponent', () => {
             'port-number': '',
             'artifact-list': []
         }
-
+        component.vnfcIdentifier = '346';
         component.prepareReferenceObject();
         expect(component.referenceDataObject['action-level']).toBe("vnfc")
     })
@@ -331,7 +332,8 @@ describe('ReferenceDataformComponent', () => {
             'user-name': '',
             'port-number': '',
             'artifact-list': []
-        }
+        };
+        component.vnfcIdentifier = '346';
         component.prepareReferenceObject();
         expect(component.referenceDataObject['action-level']).toBe("vnf")
     })
@@ -784,6 +786,14 @@ describe('ReferenceDataformComponent', () => {
         expect(fileSaved).toBe(undefined)
     })
     it('Save to appc file - should not process if device protocol is null ', () => {
+        component.tempAllData = [
+            {
+                action: "Configure",
+                scope: {
+                    'vnf-type': "testVnf"
+                }
+            }
+        ]
         component.referenceDataObject.action = "Configure"
         component.referenceDataObject['device-protocol'] = "test"
         component.appData.template.templateData = { "test": "test" }
@@ -792,7 +802,7 @@ describe('ReferenceDataformComponent', () => {
         component.actionChanged = true
         component.currentAction = "COnfigure"
         let fileSaved = component.saveToAppc();
-        //expect(fileSaved).toBe(undefined)
+        expect(fileSaved).toBe(undefined)
     })
 
     //   it('uploadfile  ', () => {  let    files = { 0: {name:'foo.XLS', size: