Skip to content

Commit

Permalink
test: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesjo committed Feb 9, 2024
1 parent 78b0950 commit 2eead52
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions src/app/features/tasks/short-syntax.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down

0 comments on commit 2eead52

Please sign in to comment.