reference-dataform.util- added test case 97/65797/2
authorArundathi Patil <arundpil@in.ibm.com>
Tue, 11 Sep 2018 10:45:34 +0000 (16:15 +0530)
committerTakamune Cho <tc012c@att.com>
Tue, 11 Sep 2018 15:05:03 +0000 (15:05 +0000)
Wrote test case to test and cover checkResult function when status code
is 400

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

index 07ccc39..d18ee0b 100644 (file)
@@ -55,4 +55,12 @@ describe('ReferenceDataFormUtil', () => {
         expect(spy).toHaveBeenCalled();
         expect(returnValue).toBe(false);
     }));
+
+    it('should test checkResult function when status is 400', inject([ReferenceDataFormUtil], (service: ReferenceDataFormUtil) => {
+        let spy = spyOn(NotificationsService.prototype, 'success');
+        let result = {output: {status: { code: '400'}}};
+        let returnValue = service.checkResult(result);
+        expect(spy).toHaveBeenCalled();
+        expect(returnValue).toBe(true);
+    }));
 });