Skip to content

Commit

Permalink
test(moment): migrate event utils
Browse files Browse the repository at this point in the history
KK-1017.

For some reason, the moment in event utils works
differently in Vite than what it worked in CRA.
However, the same method seems to work
when manually tested on a running env.
  • Loading branch information
nikomakela committed Sep 28, 2023
1 parent 188724e commit ed78c27
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/common/test/testi18nInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';

import fi from '../translation/i18n/fi.json';
import setLocale, { Locale } from '../localization/setLocale';

// eslint-disable-next-line import/no-named-as-default-member
i18n.use(initReactI18next).init({
Expand All @@ -17,4 +18,6 @@ i18n.use(initReactI18next).init({
},
});

setLocale(i18n.language as Locale);

export default i18n;
3 changes: 2 additions & 1 deletion src/domain/event/__tests__/EventUtils.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { formatOccurrenceTime } from '../EventUtils';

const startTimeRaw = new Date('2020-04-25T09:34:00+00:00');
// NOTE: After upgrade in KK-1017, this date needed the Finnish timezone, but the reason is unknown.
const startTimeRaw = new Date('2020-04-25T09:34:00+03:00');
const durationMinutes = 60;

describe('EventUtils', () => {
Expand Down

0 comments on commit ed78c27

Please sign in to comment.