aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/vnfs
diff options
context:
space:
mode:
authorArundathi Patil <arundpil@in.ibm.com>2018-09-07 21:51:52 +0530
committerTakamune Cho <tc012c@att.com>2018-09-08 01:28:11 +0000
commit6a47abc7c6e9a38fa99f86620a4cd9fd1b324070 (patch)
tree3b0bd5ab59c3a843a506369909c83615fdcc0a8e /src/app/vnfs
parent5a4fdb5990320c7ab1538b981231c49f0f6942be (diff)
added test case to reference-dataform.util service
wrote test case to test and cover checkresult function Issue-ID: APPC-1064 Change-Id: I6ba4d926ba525be3a842f73f6b6d0e727e9bfa1a Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
Diffstat (limited to 'src/app/vnfs')
-rw-r--r--src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.util.spec.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.util.spec.ts b/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.util.spec.ts
index d2ad4c4..07ccc39 100644
--- a/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.util.spec.ts
+++ b/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.util.spec.ts
@@ -29,7 +29,7 @@ import { NotificationsService } from 'angular2-notifications';
import { UtilityService } from '../../../shared/services/utilityService/utility.service';
import { HttpUtilService } from '../../../shared/services/httpUtil/http-util.service';
-fdescribe('ReferenceDataFormUtil', () => {
+describe('ReferenceDataFormUtil', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [HttpClientModule],
@@ -47,4 +47,12 @@ fdescribe('ReferenceDataFormUtil', () => {
it('should ...', inject([ReferenceDataFormUtil], (service: ReferenceDataFormUtil) => {
expect(service).toBeTruthy();
}));
+
+ it('should test checkResult function when status is 401', inject([ReferenceDataFormUtil], (service: ReferenceDataFormUtil) => {
+ let spy = spyOn(NotificationsService.prototype, 'info');
+ let result = {output: {status: { code: '401'}}};
+ let returnValue = service.checkResult(result);
+ expect(spy).toHaveBeenCalled();
+ expect(returnValue).toBe(false);
+ }));
});