From 121c673457ff9ec102a1ba65af777bf80c7d5e56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20D=C3=ADaz=20Cancillo?= Date: Sun, 28 Apr 2024 14:26:23 +0200 Subject: [PATCH] Corregidos detalles menores Login.test.js --- webapp/src/components/Login.test.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/webapp/src/components/Login.test.js b/webapp/src/components/Login.test.js index e06583ce..62789d91 100644 --- a/webapp/src/components/Login.test.js +++ b/webapp/src/components/Login.test.js @@ -63,7 +63,7 @@ describe('Login Component', () => { await waitFor(() => { expect(setLogged).toHaveBeenCalledTimes(1); - expect(screen.getByText(/Jugar/i)).toBeInTheDocument(); + expect(screen.getAllByText(/Jugar/i)).toHaveLength(2); expect(screen.getByText(/Historial de jugadas/i)).toBeInTheDocument(); expect(screen.getByText(/Ranking/i)).toBeInTheDocument(); expect(screen.getByText(/Ajustes de partida/i)).toBeInTheDocument(); @@ -112,7 +112,7 @@ describe('Login Component', () => { await waitFor(() => { expect(setLogged).toHaveBeenCalledTimes(1); - expect(screen.getByText(/Jugar/i)).toBeInTheDocument(); + expect(screen.getAllByText(/Jugar/i)).toHaveLength(2); // only for admin expect(screen.getByText(/Historial de Usuarios/i)).toBeInTheDocument(); expect(screen.getByText(/Historial de Preguntas Generadas/i)).toBeInTheDocument(); @@ -149,7 +149,7 @@ describe('Login Component', () => { }); await waitFor(() => { - expect(setLogged).toHaveBeenCalled(0); + expect(setLogged).not.toHaveBeenCalled(); expect(screen.getByText(/Internal Server Error/i)).toBeInTheDocument(); expect(screen.queryByText(/Comenzar a jugar/i)).not.toBeInTheDocument(); }); @@ -183,7 +183,7 @@ describe('Login Component', () => { }); await waitFor(() => { - expect(setLogged).toHaveBeenCalled(0); + expect(setLogged).not.toHaveBeenCalled(); expect(screen.getByText(/Error interno del servidor/i)).toBeInTheDocument(); expect(screen.queryByText(/Comenzar a jugar/i)).not.toBeInTheDocument(); }); @@ -223,7 +223,7 @@ describe('Login Component', () => { }); await waitFor(() => { - expect(setLogged).toHaveBeenCalled(0); + expect(setLogged).not.toHaveBeenCalled(); expect(screen.getByText(/Error interno del servidor/i)).toBeInTheDocument(); expect(screen.queryByText(/Comenzar a jugar/i)).not.toBeInTheDocument(); });