Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uo289659 #98

Merged
merged 2 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading