Skip to content

Commit

Permalink
Merge pull request #98 from Arquisoft/UO289659
Browse files Browse the repository at this point in the history
Uo289659
  • Loading branch information
UO289659 authored Apr 1, 2024
2 parents c398c31 + ab6d02c commit b3d7c37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 6 additions & 1 deletion gatewayservice/gateway-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ app.get('/statistics', async (req, res) => {
const questionResponse = await axios.get(statisticssServiceUrl+'/statistics', {
params: req.query,
});
res.json(questionResponse.data);
} catch (error) {
res.status(error.response.status).json({ error: error.response.data.error });
}
});

app.get('/questions', async (req, res) => {
try {
Expand Down Expand Up @@ -111,4 +116,4 @@ const server = app.listen(port, () => {
console.log(`Gateway Service listening at http://localhost:${port}`);
});

module.exports = server
module.exports = server;
1 change: 0 additions & 1 deletion webapp/src/components/Statistics.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ const dataRows = tableRows.slice(1); // Ignorar la primera fila que son los enca
dataRows.forEach(row => {
const cells = row.querySelectorAll('td'); // Obtener todas las celdas de la fila
expect(cells.length).toBe(3); // Verificar que hay exactamente 3 celdas por fila
// Puedes hacer más verificaciones aquí si es necesario, por ejemplo:
expect(cells[0]).toHaveTextContent('10'); // Verificar que la primera celda contiene el número de partidas jugadas
expect(cells[1]).toHaveTextContent('7'); // Verificar que la segunda celda contiene el número de preguntas acertadas
expect(cells[2]).toHaveTextContent('3'); // Verificar que la tercera celda contiene el número de preguntas falladas
Expand Down

0 comments on commit b3d7c37

Please sign in to comment.