test: add coverage for drafts, soundPlayer, wslNotificationHelper, and costTrackingStore

This commit is contained in:
2026-03-03 14:58:49 -08:00
committed by Naomi Carrigan
parent 58f53a421b
commit c819adc9ea
4 changed files with 293 additions and 1 deletions
+10
View File
@@ -180,6 +180,16 @@ describe("draftsStore", () => {
const result = draftsStore.formatTimestamp(invalid);
expect(result).toBe(invalid);
});
it("falls back to raw string when toLocaleString throws", () => {
const spy = vi.spyOn(Date.prototype, "toLocaleString").mockImplementation(() => {
throw new Error("Locale not supported");
});
const ts = "2026-01-15T14:30:00.000Z";
const result = draftsStore.formatTimestamp(ts);
expect(result).toBe(ts);
spy.mockRestore();
});
});
});