Skip to content

Commit

Permalink
fix: test issue with dates
Browse files Browse the repository at this point in the history
  • Loading branch information
Manumartin95 committed Mar 18, 2024
1 parent ae61b1f commit f46e345
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand All @@ -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))

Expand Down

0 comments on commit f46e345

Please sign in to comment.