Fix backend test 'run two hours forward to be in the next month in UTC' > 'has the clock set correctly' by adding a '0' in front of the month if '< 10'

This commit is contained in:
Wolfgang Huß 2023-01-02 15:31:09 +01:00
parent b640121958
commit 347e937d6b

View File

@ -183,8 +183,10 @@ describe('util/creation', () => {
})
it('has the clock set correctly', () => {
const targetMonth = targetDate.getMonth() + 1
const targetMonthString = (targetMonth < 10 ? '0' : '') + String(targetMonth)
expect(new Date().toISOString()).toContain(
`${targetDate.getFullYear()}-${targetDate.getMonth() + 1}-${targetDate.getDate()}T23:`,
`${targetDate.getFullYear()}-${targetMonthString}-${targetDate.getDate()}T23:`,
)
})