build: cleanup eslint configuration
[e-mobility-charging-stations-simulator.git] / tests / utils / Utils.test.ts
index 60170cf9ecf0df19e53daa3e54506f649b402ee3..615f76fa01f057c9bad1a1b60a7a0d16b4df54d4 100644 (file)
@@ -58,13 +58,15 @@ await describe('Utils test suite', async () => {
   });
 
   await it('Verify formatDurationMilliSeconds()', () => {
-    expect(formatDurationMilliSeconds(0)).toBe('');
+    expect(formatDurationMilliSeconds(0)).toBe('0 seconds');
+    expect(formatDurationMilliSeconds(900)).toBe('0 seconds');
     expect(formatDurationMilliSeconds(1000)).toBe('1 second');
     expect(formatDurationMilliSeconds(hoursToMilliseconds(4380))).toBe('182 days 12 hours');
   });
 
   await it('Verify formatDurationSeconds()', () => {
-    expect(formatDurationSeconds(0)).toBe('');
+    expect(formatDurationSeconds(0)).toBe('0 seconds');
+    expect(formatDurationSeconds(0.9)).toBe('0 seconds');
     expect(formatDurationSeconds(1)).toBe('1 second');
     expect(formatDurationSeconds(hoursToSeconds(4380))).toBe('182 days 12 hours');
   });
@@ -89,6 +91,7 @@ await describe('Utils test suite', async () => {
 
   await it('Verify convertToDate()', () => {
     expect(convertToDate(undefined)).toBe(undefined);
+    expect(convertToDate(null)).toBe(null);
     expect(() => convertToDate('')).toThrow(new Error("Cannot convert to date: ''"));
     expect(() => convertToDate('00:70:61')).toThrow(
       new Error("Cannot convert to date: '00:70:61'"),