From e9d54b820f7a342bd511017421a680fcffc50ed7 Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Thu, 30 Aug 2018 15:23:07 +0530 Subject: 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 --- .../shared/services/utilityService/utility.service.spec.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/app/shared/services') 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 -- cgit 1.2.3-korg