utility.service- added test cases 69/63769/2
authorArundathi Patil <arundpil@in.ibm.com>
Thu, 30 Aug 2018 09:53:07 +0000 (15:23 +0530)
committerTakamune Cho <tc012c@att.com>
Thu, 30 Aug 2018 17:48:55 +0000 (17:48 +0000)
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>
src/app/shared/services/utilityService/utility.service.spec.ts

index 80bedeb..d865f04 100644 (file)
@@ -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