Skip to content

Commit

Permalink
Ahora pasa el test e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
CANCI0 committed Mar 10, 2024
1 parent 536c56a commit 827556c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 20 deletions.
2 changes: 1 addition & 1 deletion webapp/e2e/steps/register-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ defineFeature(feature, test => {
given('An unregistered user', async () => {
username = "pablo"
password = "pabloasw"
await expect(page).toClick("button", { text: "Don't have an account? Register here." });
await expect(page).toClick("button", { text: "¿No tienes cuenta? Regístrate." });
});

when('I fill the data in the form and press submit', async () => {
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/pages/Bateria/Bateria.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const JuegoPreguntas = () => {
console.error("Error al obtener las preguntas:", error);
navigate("/home?error=1");
});
}, []);
});

useEffect(() => {
if (tiempoRestante === 0) {
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/pages/Clasico/Clasico.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const JuegoPreguntas = () => {
console.error("Error al obtener las preguntas:", error);
navigate("/home?error=1");
});
}, []);
});

useEffect(() => {
if (tiempoRestante === 0) {
Expand Down
18 changes: 1 addition & 17 deletions webapp/src/pages/Stats/Stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,6 @@ const Stats = () => {
const [isLoading, setIsLoading] = useState(true);
const [error, setError] = useState(null);

const fetchStats = () => {
setIsLoading(true);
fetch(`http://localhost:8001/getstats?user=${username}`)
.then((response) => response.json())
.then((data) => {
setStats(data);
setIsLoading(false);
})
.catch((error) => {
console.error("Error al obtener las preguntas:", error);
setError(
error.message || "Ha ocurrido un error al obtener las estadísticas"
);
setIsLoading(false);
});
};

useEffect(() => {
const delayDebounceFn = setTimeout(() => {
fetch(`http://localhost:8001/getstats?user=${username}`)
Expand All @@ -36,6 +19,7 @@ const Stats = () => {
})
.catch((error) => {
console.error("Error al obtener las preguntas:", error);
setError(error);
setIsLoading(false);
});
}, 2000);
Expand Down

0 comments on commit 827556c

Please sign in to comment.