Skip to content

Commit

Permalink
Sigo probando
Browse files Browse the repository at this point in the history
  • Loading branch information
uo287627 committed Apr 28, 2024
1 parent f455726 commit 8b8809e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion gatewayservice/gateway-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ app.post('/login', async (req, res) => {
try {
// Forward the login request to the authentication service
const authResponse = await axios.post(authServiceUrl+'/login', req.body);
console.error("RESPONSE GATEWAY... "+authResponse);//borrar
res.json(authResponse.data);
} catch (error) {
res.status(error.response.status).json({ error: error.response.data.error });
Expand Down
1 change: 1 addition & 0 deletions gatewayservice/gateway-service.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('Gateway Service', () => {
// Mock responses from external services
axios.post.mockImplementation((url, data) => {
if (url.endsWith('/login')) {
console.error("en gateway tests estamos"); // borrar
return Promise.resolve({ data: { token: 'mockedToken' } });
} else if (url.endsWith('/adduser')) {
return Promise.resolve({ data: { userId: 'mockedUserId' } });
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/Login.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('Login Component', () => {
axios.post.mockImplementation((url, data) => {
if (url.endsWith('/login')) {
console.error("En login estamos manejandonos con el mock de axios"); //borrar
return Promise.resolve({ data: { token: 'mockedToken' } });
return Promise.resolve({ data: { createdAt: 'mockedToken' } });
}else if (url.endsWith('/createUserRank')) {
return Promise.resolve({ data: { rankId: 'mockedRankId' } });
}
Expand Down

0 comments on commit 8b8809e

Please sign in to comment.