From e284a380287016025ccaa065ece9a18d109db79d Mon Sep 17 00:00:00 2001 From: UO289432 Date: Mon, 29 Apr 2024 19:49:03 +0200 Subject: [PATCH] Corregido error test temporizador --- webapp/src/components/tests/Temporizador.test.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/webapp/src/components/tests/Temporizador.test.js b/webapp/src/components/tests/Temporizador.test.js index 5f00279..ab3b77c 100644 --- a/webapp/src/components/tests/Temporizador.test.js +++ b/webapp/src/components/tests/Temporizador.test.js @@ -5,7 +5,7 @@ import Temporizador from '../Temporizador'; describe('Temporizador', () => { it('renders the initial countdown time', () => { const tiempoInicial = 60; - render(); + render(); const countdownElement = screen.getByText(tiempoInicial); expect(countdownElement).toBeInTheDocument(); }); @@ -35,7 +35,7 @@ describe('Temporizador', () => { it('restarts countdown time when restart prop changes', () => { jest.useFakeTimers(); const tiempoInicial = 60; - const { rerender } = render(); + const { rerender } = render(); act(() => { jest.advanceTimersByTime(1000); }); @@ -43,8 +43,7 @@ describe('Temporizador', () => { expect(updatedCountdownElement).toBeInTheDocument(); // Simulate restart by changing the restart prop - rerender(); + rerender(); // Countdown should restart const restartedCountdownElement = screen.getByText(tiempoInicial);