summaryrefslogtreecommitdiffstats
path: root/src/app/shared
diff options
context:
space:
mode:
authorArundathi Patil <arundpil@in.ibm.com>2018-08-30 15:23:07 +0530
committerTakamune Cho <tc012c@att.com>2018-08-30 17:48:55 +0000
commite9d54b820f7a342bd511017421a680fcffc50ed7 (patch)
tree90001def1dd937b53b882c4a86c638c66f905e06 /src/app/shared
parent7296d55883c315d8fa77fee031acdc9f04ca2dca (diff)
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 <arundpil@in.ibm.com>
Diffstat (limited to 'src/app/shared')
-rw-r--r--src/app/shared/services/utilityService/utility.service.spec.ts14
1 files changed, 13 insertions, 1 deletions
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