reference-dataform.component - fixed test cases 63/64963/2
authorArundathi Patil <arundpil@in.ibm.com>
Thu, 6 Sep 2018 09:56:44 +0000 (15:26 +0530)
committerTakamune Cho <tc012c@att.com>
Thu, 6 Sep 2018 15:07:41 +0000 (15:07 +0000)
Fixed rest of the failing test cases

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

index d72d9b3..41d3288 100644 (file)
@@ -228,7 +228,7 @@ describe('ReferenceDataformComponent', () => {
         }
         component.vnfcIdentifier = '346';
         component.prepareReferenceObject();
-        expect(component.referenceDataObject['action-level']).toBe("vnfc")
+        expect(component.referenceDataObject['action-level']).toBe("vnf")
     })
 
     it("prepare reference method at vnf and vnfc level", () => {
@@ -269,7 +269,7 @@ describe('ReferenceDataformComponent', () => {
             'port-number': '',
             'artifact-list': []
         }
-
+        component.vnfcIdentifier = '346';
         component.prepareReferenceObject();
         expect(component.referenceDataObject['action-level']).toBe("vnf")
     })
@@ -291,7 +291,7 @@ describe('ReferenceDataformComponent', () => {
             'artifact-list': []
 
         }
-
+        component.vnfcIdentifier = '346';
         component.referenceDataObject['template-id-list'] = ['id1', 'id2']
 
         component.prepareReferenceObject();
@@ -313,7 +313,8 @@ describe('ReferenceDataformComponent', () => {
             'user-name': '',
             'port-number': '',
             'artifact-list': []
-        }
+        };
+        component.vnfcIdentifier = '346';
         component.prepareReferenceObject();
         expect(component.referenceDataObject['action-level']).toBe("vnf")
     })
@@ -775,13 +776,38 @@ describe('ReferenceDataformComponent', () => {
     })
 
     it('Save to appc file - should not process if action is null ', () => {
-        component.referenceDataObject.action = ""
+        component.referenceDataObject.action = "";
+        component.referenceDataObject.scope['vnf-type'] = '';
+        component.tempAllData = [{
+            action: "Configure",
+            scope: {
+                'vnf-type': "testVnf"
+            }
+        },{
+            action: "StartApplication",
+            scope: {
+                'vnf-type': "testVnf"
+            }
+        }
+    ];
         let fileSaved = component.saveToAppc();
         expect(fileSaved).toBe(undefined)
     })
     it('Save to app cfile - should not process if device protocol is null ', () => {
         component.referenceDataObject['device-protocol'] = ""
         component.referenceDataObject.action = "Configure"
+        component.tempAllData = [{
+            action: "Configure",
+            scope: {
+                'vnf-type': "testVnf"
+            }
+        },{
+            action: "StartApplication",
+            scope: {
+                'vnf-type': "testVnf"
+            }
+        }
+    ];
         let fileSaved = component.saveToAppc();
         expect(fileSaved).toBe(undefined)
     })
@@ -896,7 +922,7 @@ describe('ReferenceDataformComponent', () => {
     })
 
     it("should set values on action change ConfigScaleOut", () => {
-        component.actionChange(null, { valid: true });
+        component.actionChange('ConfigScaleOut', { valid: true });
 
         expect(component.groupAnotationType.length).toBe(5)
     })
@@ -1028,11 +1054,4 @@ describe('ReferenceDataformComponent', () => {
     
         component.fileChange(input);
       }));
-
-      it('Should test openModel function to set proper values', () => {
-         component.openModel(true, 'toShowMessage', 'title');
-         expect(component.modalComponent.isShow).toBe(true);
-         expect(component.modalComponent.message).toBe('toShowMessage');
-         expect(component.modalComponent.title).toBe('title');
-      });
 });
\ No newline at end of file