From 103a2f796a562dbcd76deb15daca798cd1143a8a Mon Sep 17 00:00:00 2001 From: baraganio Date: Mon, 18 Mar 2024 13:38:45 +0100 Subject: [PATCH] Trying to solve some tests errors2 --- webapp/src/App.test.js | 2 +- webapp/src/components/Login.test.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/webapp/src/App.test.js b/webapp/src/App.test.js index a06b414a..3b45d50e 100644 --- a/webapp/src/App.test.js +++ b/webapp/src/App.test.js @@ -1,5 +1,5 @@ - import { render, screen } from '@testing-library/react'; +import {BrowserRouter as Router} from "react-router-dom"; import App from './App'; test('renders learn react link', () => { diff --git a/webapp/src/components/Login.test.js b/webapp/src/components/Login.test.js index 7890ef76..cc48c16e 100644 --- a/webapp/src/components/Login.test.js +++ b/webapp/src/components/Login.test.js @@ -2,6 +2,7 @@ import React from 'react'; import { render, fireEvent, screen, waitFor, act } from '@testing-library/react'; import axios from 'axios'; import MockAdapter from 'axios-mock-adapter'; +import {BrowserRouter as Router} from "react-router-dom"; import Login from './Login'; const mockAxios = new MockAdapter(axios); @@ -12,11 +13,10 @@ describe('Login component', () => { }); it('should log in successfully', async () => { - render( + render( - - ); + ); const usernameInput = screen.getByLabelText(/Username/i); const passwordInput = screen.getByLabelText(/Password/i);