diff --git a/webapp/src/components/AddUser.test.js b/webapp/src/components/AddUser.test.js index 87334886..827d8df5 100644 --- a/webapp/src/components/AddUser.test.js +++ b/webapp/src/components/AddUser.test.js @@ -3,6 +3,7 @@ import { render, fireEvent, screen, waitFor } from '@testing-library/react'; import axios from 'axios'; import MockAdapter from 'axios-mock-adapter'; import AddUser from './AddUser'; +import { BrowserRouter} from 'react-router-dom'; const mockAxios = new MockAdapter(axios); @@ -12,7 +13,11 @@ describe('AddUser component', () => { }); it('should add user successfully', async () => { - render(); + render( + + + + ); const usernameInput = screen.getByLabelText(/Username/i); const passwordInput = screen.getByLabelText(/Password/i); @@ -35,7 +40,11 @@ describe('AddUser component', () => { }); it('should handle error when adding user', async () => { - render(); + render( + + + + ); const usernameInput = screen.getByLabelText(/Username/i); const passwordInput = screen.getByLabelText(/Password/i); diff --git a/webapp/src/components/Login.test.js b/webapp/src/components/Login.test.js index 4966c524..854b18b7 100644 --- a/webapp/src/components/Login.test.js +++ b/webapp/src/components/Login.test.js @@ -78,10 +78,5 @@ describe('Login component', () => { // Verificar que no hay token en localStorage expect(localStorage.getItem('token')).toBeNull(); - console.log('AAAAAAA' - + window.location.pathname); - - // Verificamos que no se ha ido a Home - expect(window.location.pathname).not.toBe('/home'); }); }); \ No newline at end of file