summaryrefslogtreecommitdiffstats
path: root/src/app/shared/services/utilityService/utility.service.spec.ts
diff options
context:
space:
mode:
authorsj108s <sj108s@us.att.com>2018-03-13 20:29:58 +0530
committersj108s <sj108s@us.att.com>2018-03-13 20:30:50 +0530
commitf1e61ce405cf11ea77fe98abd5e10f7ed2d72611 (patch)
tree0d6f464a3c8e275b2b74359f81282aaf589074fe /src/app/shared/services/utilityService/utility.service.spec.ts
parent8ac6f161c2260e48a743df82e57b4ba24ce9795c (diff)
Fixed defects in test screen & updated test cases
Fixed few defects raised by ST in test screen and also updated test cases to improve coverage. Also,changed code to match onap standards, and rectfied grep code violations. Issue-ID: APPC-730 Change-Id: I0286c38eb4f76dc8c0253a4ccab721b3ccfeff9d Signed-off-by: sj108s <sj108s@us.att.com>
Diffstat (limited to 'src/app/shared/services/utilityService/utility.service.spec.ts')
-rw-r--r--src/app/shared/services/utilityService/utility.service.spec.ts12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/app/shared/services/utilityService/utility.service.spec.ts b/src/app/shared/services/utilityService/utility.service.spec.ts
index c11927a..85b4818 100644
--- a/src/app/shared/services/utilityService/utility.service.spec.ts
+++ b/src/app/shared/services/utilityService/utility.service.spec.ts
@@ -21,9 +21,6 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property.
============LICENSE_END============================================
*/
-
-/* tslint:disable:no-unused-variable */
-
import {inject, TestBed} from '@angular/core/testing';
import {UtilityService} from './utility.service';
import {NotificationsService} from 'angular2-notifications';
@@ -39,11 +36,16 @@ describe('UtilityService', () => {
expect(service).toBeTruthy();
}));
+ it('should generate random id', inject([UtilityService],(service: UtilityService) => {
+ let ret = service.randomId();
+
+ expect(ret).not.toBeNull();
+ }));
it('should apply slashes for a string...', inject([UtilityService], (service: UtilityService) => {
- let text = {'vnf-host-ip-address': '135.21.166.36'};
+ let text = {'vnf-host-ip-address': 'testidaddress'};
- expect(service.appendSlashes(JSON.stringify(text))).toEqual('{\\"vnf-host-ip-address\\":\\"135.21.166.36\\"}');
+ expect(service.appendSlashes(JSON.stringify(text))).toEqual('{\\"vnf-host-ip-address\\":\\"testidaddress\\"}');
}));