Reference-dataform- test cases 97/57997/3
authorArundathi Patil <arundpil@in.ibm.com>
Mon, 30 Jul 2018 09:58:56 +0000 (15:28 +0530)
committerTakamune Cho <tc012c@att.com>
Thu, 2 Aug 2018 23:23:58 +0000 (23:23 +0000)
Wrote test case to cover upload function in refernce-dataform.component

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

index 3d899c1..fbf6d72 100644 (file)
@@ -2,6 +2,8 @@
 ============LICENSE_START==========================================
 ===================================================================
 Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+
+Modification Copyright (C) 2018 IBM.
 ===================================================================
 
 Unless otherwise specified, all software contained herein is licensed
@@ -993,4 +995,14 @@ describe('ReferenceDataformComponent', () => {
         component.deviceProtocolChange();
         expect(spy).toHaveBeenCalled()
     });
+
+    it('should test uplaod function', () => {        
+        let content = "Hello World";  
+        let data = new Blob([content], { type: 'text/plain' });  
+        let arrayOfBlob = new Array<Blob>();  
+        arrayOfBlob.push(data);  
+        let file = new File(arrayOfBlob, "Mock.XLS"); 
+        let evnt = {target: {files: [file]}};
+        component.upload(evnt);
+    });
 });
\ No newline at end of file