Skip to content

Commit

Permalink
fix: Mock date of the day for shouldFullSync
Browse files Browse the repository at this point in the history
  • Loading branch information
KillianCourvoisier committed Jul 26, 2024
1 parent e0f0eee commit 40d3391
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/cozy-clisk/src/contentscript/ContentScript.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,13 @@ describe('ContentScript', () => {
})
})
describe('shouldFullSync', () => {
const fixedDate = new Date('2024-07-24T14:55:57.83761233+02:00').getTime()
beforeAll(() => {
jest.spyOn(Date, 'now').mockImplementation(() => fixedDate)
})
afterAll(() => {
jest.restoreAllMocks()
})
it('should force full sync if forceFullSync flag is activated', async () => {
const contentScript = new ContentScript()
contentScript.contentScriptType = PILOT_TYPE
Expand Down

0 comments on commit 40d3391

Please sign in to comment.