reference-data-form - added test case 15/58915/2
authorArundathi Patil <arundpil@in.ibm.com>
Fri, 3 Aug 2018 10:13:05 +0000 (15:43 +0530)
committerTakamune Cho <tc012c@att.com>
Fri, 3 Aug 2018 21:02:10 +0000 (21:02 +0000)
added test case to cover fileChange() method in reference-data-form spec
file.

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

index fbf6d72..f39f08b 100644 (file)
@@ -1005,4 +1005,16 @@ describe('ReferenceDataformComponent', () => {
         let evnt = {target: {files: [file]}};
         component.upload(evnt);
     });
+
+    it('Should validatte fileChange method if file type is xml', async(() => {
+        let reader = new FileReader();
+        let content = "{data : '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 input = {target: {files: [file]}};
+    
+        component.fileChange(input);
+      }));
 });
\ No newline at end of file