From 87f05df70966bb7dfae0803063f6ad4a7742e6e8 Mon Sep 17 00:00:00 2001 From: Saumya Tripathi Date: Tue, 19 May 2026 21:17:30 +0530 Subject: [PATCH 1/2] test: add fallback unit tests for formatLocaleDate and Time #78 --- frontend/testing/unit/utils/date.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/frontend/testing/unit/utils/date.test.ts b/frontend/testing/unit/utils/date.test.ts index 80bfe40e..7a285f45 100644 --- a/frontend/testing/unit/utils/date.test.ts +++ b/frontend/testing/unit/utils/date.test.ts @@ -60,6 +60,14 @@ import { test("returns N/A for invalid input", () => { expect(formatLocaleDate("bad-date")).toBe("N/A"); }); + + test("returns N/A for null input", () => { + expect(formatLocaleDate(null)).toBe("N/A"); + }); + + test("returns N/A for undefinied input", () =>{ + expect(formatLocaleDate(undefined)).toBe("N/A"); + }); }); describe("formatLocaleTime", () => { @@ -71,6 +79,14 @@ import { test("returns N/A for invalid input", () => { expect(formatLocaleTime("bad-date")).toBe("N/A"); }); + + test("returns N/A for null input", () => { + expect (formatLocaleTime(null)).toBe("N/A"); + }); + + test("returns N/A for undefinied input", () =>{ + expect(formatLocaleTime(undefined)).toBe("N/A"); + }); }); describe("timezone preference safety", () => { From 3cb67a43709839136728d528f62bac98a61d2ba3 Mon Sep 17 00:00:00 2001 From: Saumya Tripathi Date: Sat, 23 May 2026 21:10:34 +0530 Subject: [PATCH 2/2] chore: fix typos and resolve formatting nits in date tests --- frontend/testing/unit/utils/date.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/testing/unit/utils/date.test.ts b/frontend/testing/unit/utils/date.test.ts index 7a285f45..7d878d32 100644 --- a/frontend/testing/unit/utils/date.test.ts +++ b/frontend/testing/unit/utils/date.test.ts @@ -65,7 +65,7 @@ import { expect(formatLocaleDate(null)).toBe("N/A"); }); - test("returns N/A for undefinied input", () =>{ + test("returns N/A for undefined input", () => { expect(formatLocaleDate(undefined)).toBe("N/A"); }); }); @@ -81,10 +81,10 @@ import { }); test("returns N/A for null input", () => { - expect (formatLocaleTime(null)).toBe("N/A"); + expect(formatLocaleTime(null)).toBe("N/A"); }); - test("returns N/A for undefinied input", () =>{ + test("returns N/A for undefined input", () => { expect(formatLocaleTime(undefined)).toBe("N/A"); }); });