From b0ecbca224ad40347f1947db5eecaff3f0c5d6c2 Mon Sep 17 00:00:00 2001 From: Zsolt Stenger Date: Mon, 25 Dec 2023 09:07:19 +0100 Subject: [PATCH] 3rd test fix try to init root at start --- frontend/src/App.test.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/frontend/src/App.test.js b/frontend/src/App.test.js index 33b568eba..973976425 100644 --- a/frontend/src/App.test.js +++ b/frontend/src/App.test.js @@ -52,22 +52,22 @@ test('async test for page data', async () => { await waitFor(() => screen.getByText('Welcome To')); }); -test('async test for language change', async () => { - const { container } = render(); - +jest.mock('react-i18next', () => ({ + useTranslation: () => ({ t: key => key }) +})); + +test('async test for page data', async () => { + render( + + + + ); + const signInButton = screen.getByText('Sign In via 42'); userEvent.click(signInButton); - + await waitFor(() => screen.getByText('Logout')); await waitFor(() => screen.getByText('Welcome To')); - - const languageLink = screen.getByText('Language'); - fireEvent.click(languageLink); - - const huOption = screen.getByText('HU'); - fireEvent.click(huOption); - - await waitFor(() => screen.getByText('Üdvözlünk a')); }); // test('renders chat page', () => {