From 347e937d6b4ed2ce50abe87e34d97a3a1ba18448 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Mon, 2 Jan 2023 15:31:09 +0100 Subject: [PATCH] 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' --- backend/src/graphql/resolver/util/creations.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/graphql/resolver/util/creations.test.ts b/backend/src/graphql/resolver/util/creations.test.ts index 6be317e16..e9c1997f6 100644 --- a/backend/src/graphql/resolver/util/creations.test.ts +++ b/backend/src/graphql/resolver/util/creations.test.ts @@ -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:`, ) })