mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' into 2285-mark-creation-via-link
This commit is contained in:
commit
2caa0ad4c9
@ -170,8 +170,11 @@ describe('util/creation', () => {
|
|||||||
const targetDate = new Date(now.getFullYear(), now.getMonth() + 1, 0, 23, 0, 0)
|
const targetDate = new Date(now.getFullYear(), now.getMonth() + 1, 0, 23, 0, 0)
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
|
const halfMsToRun = (targetDate.getTime() - now.getTime()) / 2
|
||||||
jest.useFakeTimers()
|
jest.useFakeTimers()
|
||||||
setTimeout(jest.fn(), targetDate.getTime() - now.getTime())
|
setTimeout(jest.fn(), halfMsToRun)
|
||||||
|
jest.runAllTimers()
|
||||||
|
setTimeout(jest.fn(), halfMsToRun)
|
||||||
jest.runAllTimers()
|
jest.runAllTimers()
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -225,8 +228,10 @@ describe('util/creation', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('has the clock set correctly', () => {
|
it('has the clock set correctly', () => {
|
||||||
|
const targetMonth = nextMonthTargetDate.getMonth() + 1
|
||||||
|
const targetMonthString = (targetMonth < 10 ? '0' : '') + String(targetMonth)
|
||||||
expect(new Date().toISOString()).toContain(
|
expect(new Date().toISOString()).toContain(
|
||||||
`${nextMonthTargetDate.getFullYear()}-${nextMonthTargetDate.getMonth() + 1}-01T01:`,
|
`${nextMonthTargetDate.getFullYear()}-${targetMonthString}-01T01:`,
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user