diff --git a/webapp/src/components/AddUser.test.js b/webapp/src/components/AddUser.test.js index c9f09b12..8a2dedc6 100644 --- a/webapp/src/components/AddUser.test.js +++ b/webapp/src/components/AddUser.test.js @@ -59,15 +59,17 @@ describe('AddUser component', () => { }); }); */ + +import AddUser from './AddUser'; import React from 'react'; import { render } from '@testing-library/react'; -import AddUser from './AddUser'; +import { BrowserRouter } from 'react-router-dom'; // Import BrowserRouter -describe('./AddUser', () => { - it('should render the component without crashing', () => { - // Render the component - render(); +describe('./AddUser', () => { + it('should render the Login component without crashing', () => { + // Wrap Login within BrowserRouter to provide routing context + render(); }); }); diff --git a/webapp/src/components/Login.test.js b/webapp/src/components/Login.test.js index 597d0149..e9b4a9ad 100644 --- a/webapp/src/components/Login.test.js +++ b/webapp/src/components/Login.test.js @@ -65,12 +65,12 @@ describe('Login component', () => { import React from 'react'; import { render } from '@testing-library/react'; -import Login from './Login';; +import { BrowserRouter } from 'react-router-dom'; // Import BrowserRouter +import Login from './Login'; // Assuming Login is the component under test describe('./Login', () => { - it('should render the component without crashing', () => { - // Render the component - render(); - + it('should render the Login component without crashing', () => { + // Wrap Login within BrowserRouter to provide routing context + render(); }); });