From 77bfa5b5ef9a1f97e38837334ccbdcb70ff1117d Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Mon, 2 Jan 2023 17:46:39 +0100 Subject: [PATCH 1/2] expect current(local) year to be visible in the footer. --- frontend/src/components/ContentFooter.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/ContentFooter.spec.js b/frontend/src/components/ContentFooter.spec.js index c578d3fac..29d13bc28 100644 --- a/frontend/src/components/ContentFooter.spec.js +++ b/frontend/src/components/ContentFooter.spec.js @@ -32,8 +32,8 @@ describe('ContentFooter', () => { expect(wrapper.find('div.copyright').exists()).toBeTruthy() }) - it('renders the copyright year', () => { - expect(mocks.$t).toBeCalledWith('footer.copyright.year', { year: 2022 }) + it('renders the current year as copyright year', () => { + expect(mocks.$t).toBeCalledWith('footer.copyright.year', { year: new Date().getFullYear() }) }) it('renders a link to Gradido-Akademie', () => { From f83b9a762c564f3185423613ee01adf925e9191f Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 3 Jan 2023 12:41:42 +0100 Subject: [PATCH 2/2] also fix backend month test --- 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..d9ccf6936 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 targetMonthString = + (targetDate.getMonth() + 1 < 10 ? '0' : '') + String(targetDate.getMonth() + 1) expect(new Date().toISOString()).toContain( - `${targetDate.getFullYear()}-${targetDate.getMonth() + 1}-${targetDate.getDate()}T23:`, + `${targetDate.getFullYear()}-${targetMonthString}-${targetDate.getDate()}T23:`, ) })