diff --git a/src/utils/string/index.ts b/src/utils/string/index.ts index c19572ae7c..423024e5ee 100644 --- a/src/utils/string/index.ts +++ b/src/utils/string/index.ts @@ -28,6 +28,7 @@ export const msToDuration = (ms: number): string => { if (seconds > 0) { return `${seconds}s`; } + return `${ms}ms`; }; /** diff --git a/src/utils/string/string.test.ts b/src/utils/string/string.test.ts index 35b0197f13..bbb219de24 100644 --- a/src/utils/string/string.test.ts +++ b/src/utils/string/string.test.ts @@ -44,6 +44,10 @@ describe("msToDuration", () => { const ms = 25000; expect(msToDuration(ms)).toBe("25s"); }); + it("does not convert milli < 1s", () => { + const ms = 500; + expect(msToDuration(ms)).toBe("500ms"); + }); }); describe("sortFunctionDate", () => {