From 8b8809e82510ca56dcd729864836d76d36217f40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20D=C3=ADaz=20Cancillo?= Date: Sun, 28 Apr 2024 13:26:55 +0200 Subject: [PATCH] Sigo probando --- gatewayservice/gateway-service.js | 1 - gatewayservice/gateway-service.test.js | 1 + webapp/src/components/Login.test.js | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gatewayservice/gateway-service.js b/gatewayservice/gateway-service.js index 65446cae..76f33380 100644 --- a/gatewayservice/gateway-service.js +++ b/gatewayservice/gateway-service.js @@ -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 }); diff --git a/gatewayservice/gateway-service.test.js b/gatewayservice/gateway-service.test.js index a63c2527..6df69c6b 100644 --- a/gatewayservice/gateway-service.test.js +++ b/gatewayservice/gateway-service.test.js @@ -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' } }); diff --git a/webapp/src/components/Login.test.js b/webapp/src/components/Login.test.js index 0ebbc08f..3d6685e7 100644 --- a/webapp/src/components/Login.test.js +++ b/webapp/src/components/Login.test.js @@ -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' } }); }