From 7ad455b70060bd51fbecc418da44ef5bebc3e95d Mon Sep 17 00:00:00 2001 From: RubenFern Date: Sun, 14 Apr 2024 18:55:29 +0200 Subject: [PATCH] add import i18n to tests --- webapp/src/components/game/Game.test.js | 1 + webapp/src/components/game/SuddenDeath.test.js | 1 + webapp/src/components/profile/Profile.test.js | 2 +- webapp/src/components/settings/Settings.test.js | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/webapp/src/components/game/Game.test.js b/webapp/src/components/game/Game.test.js index dae91359..b99cd0ef 100644 --- a/webapp/src/components/game/Game.test.js +++ b/webapp/src/components/game/Game.test.js @@ -3,6 +3,7 @@ import {render, screen, fireEvent, act, waitFor} from '@testing-library/react'; import '@testing-library/jest-dom'; import {Game} from './Game'; import { MemoryRouter, Route } from 'react-router-dom'; +import "../../i18n"; jest.mock('../../services/game.service', () => ({ startNewGame: () => Promise.resolve(""), diff --git a/webapp/src/components/game/SuddenDeath.test.js b/webapp/src/components/game/SuddenDeath.test.js index 98543ab9..14e8d44c 100644 --- a/webapp/src/components/game/SuddenDeath.test.js +++ b/webapp/src/components/game/SuddenDeath.test.js @@ -5,6 +5,7 @@ import {SuddenDeath} from './SuddenDeath'; import Game from "./Game"; import { MemoryRouter, Route } from 'react-router-dom'; import * as router from "react-router"; +import "../../i18n"; jest.mock('../../services/game.service', () => ({ startNewGame: () => Promise.resolve(""), diff --git a/webapp/src/components/profile/Profile.test.js b/webapp/src/components/profile/Profile.test.js index dee68282..cde68c78 100644 --- a/webapp/src/components/profile/Profile.test.js +++ b/webapp/src/components/profile/Profile.test.js @@ -3,7 +3,7 @@ import { render, screen, act, waitFor } from '@testing-library/react'; import '@testing-library/jest-dom'; import { Profile } from './Profile'; import { MemoryRouter } from 'react-router-dom'; - +import "../../i18n"; jest.mock('../../services/user.service', () => ({ getCurrentUser: () => { diff --git a/webapp/src/components/settings/Settings.test.js b/webapp/src/components/settings/Settings.test.js index 4917bb05..ef03ec80 100644 --- a/webapp/src/components/settings/Settings.test.js +++ b/webapp/src/components/settings/Settings.test.js @@ -3,6 +3,7 @@ import { render, screen, fireEvent, act } from '@testing-library/react'; import '@testing-library/jest-dom'; import { MemoryRouter } from 'react-router-dom'; import { Settings } from './Settings'; +import "../../i18n"; jest.mock('../../services/game.service', () => ({ getGameSettings: () => Promise.resolve({ durationQuestion: 30, numberOfQuestions: 10 }),