Skip to content

Commit

Permalink
fix: update jest mock [DHIS2-15415]
Browse files Browse the repository at this point in the history
  • Loading branch information
tomzemp committed Aug 8, 2023
1 parent a978552 commit be1a01a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/shared/approval-status/get-approval-status.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import { Approved, Ready, Waiting } from './icons.js'

jest.mock('moment', () => {
const now = new Date()
const yearTwoYearsAgo = now.getFullYear() - 2
return () =>
jest.requireActual('moment')(`${yearTwoYearsAgo}-01-01T00:00:00.000Z`)
now.setFullYear(now.getFullYear() - 2)
return () => jest.requireActual('moment')(now)
})

describe('getApprovalStatusDisplayData', () => {
Expand Down

0 comments on commit be1a01a

Please sign in to comment.