Skip to content

Commit

Permalink
Merge pull request #314 from dhis2/DHIS2-15554/fix-jest-test
Browse files Browse the repository at this point in the history
fix: update jest mock [DHIS2-15415]
  • Loading branch information
kabaros authored Sep 13, 2023
2 parents cd8aa4e + be1a01a commit 3b2ca75
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 3b2ca75

Please sign in to comment.