From 2eead52e0917cdf727bf423f8f512a7877e51c6a Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Fri, 9 Feb 2024 11:06:28 +0100 Subject: [PATCH] test: fix --- src/app/features/tasks/short-syntax.spec.ts | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/app/features/tasks/short-syntax.spec.ts b/src/app/features/tasks/short-syntax.spec.ts index 3c550bb581e..f026c10cf36 100644 --- a/src/app/features/tasks/short-syntax.spec.ts +++ b/src/app/features/tasks/short-syntax.spec.ts @@ -198,24 +198,7 @@ describe('shortSyntax', () => { // 5 represents Friday expect(parsedDate.getDay()).toEqual(5); const now = new Date(); - const todayInNumber = now.getDay(); - let dayIncrement = 0; - // If today happens to be Friday, the parsed date will be the next Friday, - // 7 days from today - if (todayInNumber === 5) { - dayIncrement = 7; - } else { - if (todayInNumber < 5) { - dayIncrement = 5 - todayInNumber; - } else { - dayIncrement = 7 - todayInNumber + 5; - } - } - const nextFriday = new Date( - now.getFullYear(), - now.getMonth(), - now.getDate() + dayIncrement, - ); + const nextFriday = new Date(now.getFullYear(), now.getMonth(), now.getDate()); const isDateSetCorrectly = checkSameDay(parsedDate, nextFriday); expect(isDateSetCorrectly).toBeTrue(); });