From: Arundathi Patil Date: Thu, 30 Aug 2018 09:53:07 +0000 (+0530) Subject: utility.service- added test cases X-Git-Tag: 1.4.0~32 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F69%2F63769%2F2;p=appc%2Fcdt.git utility.service- added test cases added test cases to test an cover new metho 'setTraceVl()' function in utility.service Issue-ID: APPC-1064 Change-Id: Ifd9c87e48b36e8d11614de68a0f022b01b4d3537 Signed-off-by: Arundathi Patil --- diff --git a/src/app/shared/services/utilityService/utility.service.spec.ts b/src/app/shared/services/utilityService/utility.service.spec.ts index 80bedeb..d865f04 100644 --- a/src/app/shared/services/utilityService/utility.service.spec.ts +++ b/src/app/shared/services/utilityService/utility.service.spec.ts @@ -91,4 +91,16 @@ describe('UtilityService', () => { let obj = [{data : 'data'}]; expect(service.checkNotNull(obj)).toBe(true); })); -}); + + it('should test setTracelvl function with proper trace value', inject([UtilityService], (service: UtilityService) => { + service.setTracelvl(1); + let traceValue = localStorage.getItem("Tracelvl"); + expect(traceValue).toBe("1") + })); + + it('should test setTracelvl function with no tracevalue', inject([UtilityService], (service: UtilityService) => { + service.setTracelvl(null); + let traceValue = localStorage.getItem("Tracelvl"); + expect(traceValue).toBe("0") + })); +}); \ No newline at end of file