diff --git a/webapp/src/components/Login.js b/webapp/src/components/Login.js index 4a65040a..49028c5a 100644 --- a/webapp/src/components/Login.js +++ b/webapp/src/components/Login.js @@ -46,7 +46,6 @@ const Login = ({ setLogged }) => { const response = await axios.post(`${apiEndpoint}/login`, { username, password }); const { createdAt: userCreatedAt } = response.data; await axios.get(`${apiEndpoint}/getAllUsers`); - // const users = usersResponse.data; setCreatedAt(userCreatedAt); setLoginSuccess(true); setLogged(); diff --git a/webapp/src/components/Login.test.js b/webapp/src/components/Login.test.js index 11f82d58..bf4feb04 100644 --- a/webapp/src/components/Login.test.js +++ b/webapp/src/components/Login.test.js @@ -195,7 +195,7 @@ describe('Login Component', () => { }); await waitFor(() => { - if (loggedIn) { + if (!loggedIn) { expect(setLogged).not.toHaveBeenCalled(); } else { expect(setLogged).toHaveBeenCalled(); @@ -247,7 +247,6 @@ describe('Login Component', () => { // Mock para la peticiĆ³n POST de login fallada axios.post.mockRejectedValueOnce({ response: { status: 500, data: { error: 'Internal Server Error' } } }); - performLoginFail(setLogged, 'testUser', 'testPassword', 'Internal Server Error', false); await performLoginFail(setLogged, 'testUser', 'testPassword', 'Espere, estamos cargando sus datos...', true); }); });