generated from nhcarrigan/template
test: add coverage for drafts, soundPlayer, wslNotificationHelper, and costTrackingStore
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user