From 3957cd26207f6f5ebbad22797fa6f89a80ca4971 Mon Sep 17 00:00:00 2001 From: Jacobtread Date: Sun, 7 Apr 2024 14:14:40 +1200 Subject: [PATCH] fix: tests badge name, more trying to get time tests working --- README.md | 2 +- src/utils/time.test.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6e6be4b..a1ba24e 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ![License](https://img.shields.io/github/license/jacobtread/obsidian-timekeep?style=for-the-badge) ![Build](https://img.shields.io/github/actions/workflow/status/jacobtread/obsidian-timekeep/build.yml?style=for-the-badge) -![Tests](https://img.shields.io/github/actions/workflow/status/jacobtread/obsidian-timekeep/tests.yml?style=for-the-badge) +![Tests](https://img.shields.io/github/actions/workflow/status/jacobtread/obsidian-timekeep/tests.yml?style=for-the-badge&label=Tests) This plugin provides a way to simply and easily track time spent on various tasks. After tracking your time you can export the tracked time as a **Markdown Table**, **CSV**, **JSON**, or **PDF** diff --git a/src/utils/time.test.ts b/src/utils/time.test.ts index ffb6d7d..53f2fbd 100644 --- a/src/utils/time.test.ts +++ b/src/utils/time.test.ts @@ -33,15 +33,15 @@ it("should format editable time", () => { }); it("should unformat editable time", () => { - const input = "2024-03-31 15:34:45"; - const expected = moment("2024-03-31T02:34:45.000Z").utc(); + const input = "2024-03-31 02:34:45"; + const expected = moment.utc("2024-03-31T02:34:45.000Z"); const settings: TimekeepSettings = defaultSettings; settings.editableTimestampFormat = "YYYY-MM-DD HH:mm:ss"; const output = unformatEditableTimestamp(input, settings).utc(); - expect(output.toISOString()).toBe(expected.toISOString()); + expect(output.toDate()).toStrictEqual(expected.toDate()); }); describe("format duration", () => {