From 096fc0bbc84ff14ca459cd0044baf971f8e45d40 Mon Sep 17 00:00:00 2001 From: kolaente Date: Fri, 9 Jul 2021 09:48:33 +0200 Subject: [PATCH] Fix tests failing on thursdays --- src/helpers/parseTaskText.test.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/helpers/parseTaskText.test.js b/src/helpers/parseTaskText.test.js index 459ad628d..94382558f 100644 --- a/src/helpers/parseTaskText.test.js +++ b/src/helpers/parseTaskText.test.js @@ -168,7 +168,6 @@ describe('Parse Task Text', () => { const nextThursday = new Date() nextThursday.setDate(nextThursday.getDate() + ((4 + 7 - nextThursday.getDay()) % 7)) expect(`${result.date.getFullYear()}-${result.date.getMonth()}-${result.date.getDate()}`).toBe(`${nextThursday.getFullYear()}-${nextThursday.getMonth()}-${nextThursday.getDate()}`) - expect(+new Date(result.date)).toBeGreaterThan(+new Date() - 10) // In on thursdays, this may be different by one second and thus fails the test }) it('should recognize weekdays with time', () => { const result = parseTaskText('Lorem Ipsum thu at 14:00') @@ -178,7 +177,6 @@ describe('Parse Task Text', () => { nextThursday.setDate(nextThursday.getDate() + ((4 + 7 - nextThursday.getDay()) % 7)) expect(`${result.date.getFullYear()}-${result.date.getMonth()}-${result.date.getDate()}`).toBe(`${nextThursday.getFullYear()}-${nextThursday.getMonth()}-${nextThursday.getDate()}`) expect(`${result.date.getHours()}:${result.date.getMinutes()}`).toBe('14:0') - expect(+new Date(result.date)).toBeGreaterThan(+new Date() - 10) // In on thursdays, this may be different by one second and thus fails the test }) it('should recognize dates of the month in the past but next month', () => { const date = new Date()