reference-dataform.component: added test case 93/65793/1
authorArundathi Patil <arundpil@in.ibm.com>
Tue, 11 Sep 2018 10:39:29 +0000 (16:09 +0530)
committerIBM602-PC0F1E3C\Arundathi <arundpil@in.ibm.com>
Tue, 11 Sep 2018 10:39:47 +0000 (16:09 +0530)
Wrote test case to test and cover displayHandleVnfc function when vnfc
variable in mapping-editor.sevice is true.

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

index e69b8f8..499de2a 100644 (file)
@@ -1108,6 +1108,26 @@ describe('ReferenceDataformComponent', () => {
         expect(component.vnfcIdentifier).toBe('346');
     }));
 
+    it('should test displayHideVnfc function vnfc is true', inject([MappingEditorService], (service: MappingEditorService) => {
+        component.referenceDataObject = {
+            action: 'ConfigScaleOut',
+            'action-level': 'vnf',
+            scope: {
+                'vnf-type': '',
+                'vnfc-type-list': ['346']
+            },
+            'template': 'Y',
+            vm: [],
+            'device-protocol': '',
+            'user-name': '',
+            'port-number': '',
+            'artifact-list': []
+        };
+        service.newObject = { vnfc: true};
+        component.displayHideVnfc();
+        expect(component.vnfcIdentifier).toBe(true);
+    }));
+
     // afterEach(function() {
     //     jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
     // });