From f46e3451889b50821597531072434f6fadca823e Mon Sep 17 00:00:00 2001 From: Manumartin95 Date: Mon, 18 Mar 2024 10:17:01 +0100 Subject: [PATCH] fix: test issue with dates --- .../activity/ui/hooks/use-get-selected-calendar-date.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/binnacle/features/activity/ui/hooks/use-get-selected-calendar-date.test.ts b/src/features/binnacle/features/activity/ui/hooks/use-get-selected-calendar-date.test.ts index 37036d9a..56e49779 100644 --- a/src/features/binnacle/features/activity/ui/hooks/use-get-selected-calendar-date.test.ts +++ b/src/features/binnacle/features/activity/ui/hooks/use-get-selected-calendar-date.test.ts @@ -13,7 +13,7 @@ describe('useGetSelectedCalendarDate', () => { }) it('should return the last month of the selected year', () => { - const pastDate = new Date(2020, 6, 1) // Jun 1, 2020 + const pastDate = new Date(new Date().getFullYear() - 1, 6, 1) // Jun 1, 2020 const { result } = renderHook(() => useGetSelectedCalendarDate(pastDate)) @@ -22,7 +22,7 @@ describe('useGetSelectedCalendarDate', () => { }) it('should return the first month of the selected year', () => { - const nextDate = new Date(2024, 7, 2) // July 2, 2024 + const nextDate = new Date(new Date().getFullYear() + 1, 7, 2) // July 2, 2024 const { result } = renderHook(() => useGetSelectedCalendarDate(nextDate))