From 7f3770301fa5c69c0aab2c25bc82582b594e8039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20D=C3=ADaz=20Cancillo?= Date: Sun, 28 Apr 2024 16:49:54 +0200 Subject: [PATCH] Sigo reparando las issues --- .../components/GeneratedQuestionsList.test.js | 8 +++---- webapp/src/components/RankingList.test.js | 24 +++++++++---------- webapp/src/components/RecordList.test.js | 2 +- webapp/src/components/UsersList.test.js | 8 +++---- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/webapp/src/components/GeneratedQuestionsList.test.js b/webapp/src/components/GeneratedQuestionsList.test.js index 6cc4adba..40713a78 100644 --- a/webapp/src/components/GeneratedQuestionsList.test.js +++ b/webapp/src/components/GeneratedQuestionsList.test.js @@ -5,7 +5,7 @@ import GeneratedQuestionsList from './GeneratedQuestionsList'; describe('GeneratedQuestionsList component', () => { // Test for rendering the component and checking the main heading test('renders GeneratedQuestionsList component and main heading', () => { - render(); + render( {}} />); // Check if the main heading is in the document const heading = screen.getByRole('heading', { name: /Lista de preguntas/i }); @@ -14,7 +14,7 @@ describe('GeneratedQuestionsList component', () => { // Test for rendering the table it('should display the table', () => { - render(); + render( {}} />); const table = screen.getByRole('table'); expect(table).toBeInTheDocument(); @@ -22,7 +22,7 @@ describe('GeneratedQuestionsList component', () => { // Test for rendering the table headers test('renders table headers', () => { - render(); + render( {}} />); // Check if the table headers are in the document const questionHeader = screen.getByRole('columnheader', { name: /Pregunta/i }); @@ -33,7 +33,7 @@ describe('GeneratedQuestionsList component', () => { // Test for rendering the table rows test('renders table rows', () => { - render(); + render( {}} />); // Check if the table rows are in the document const tableRows = screen.getAllByRole('row'); diff --git a/webapp/src/components/RankingList.test.js b/webapp/src/components/RankingList.test.js index 8c7e6b9a..652132f6 100644 --- a/webapp/src/components/RankingList.test.js +++ b/webapp/src/components/RankingList.test.js @@ -48,14 +48,14 @@ describe('RankingList', () => { it('renders without crashing', async () => { await act(async () => { - render(); + render( {}} />); }); }); test('renders RankingList component and main heading', async () => { await act(async () => { - render(); + render( {}} />); }); // Check if the main heading is in the document @@ -66,7 +66,7 @@ describe('RankingList', () => { // Test for rendering the column headers test('renders column headers', async () => { await act(async () => { - render(); + render( {}} />); }); // Check if the column headers are in the document @@ -77,7 +77,7 @@ describe('RankingList', () => { // Test for rendering the table it('should display the table', async () => { await act(async () => { - render(); + render( {}} />); }); const table = screen.getByRole('table'); @@ -87,7 +87,7 @@ describe('RankingList', () => { test('tests tabla ranking', async () => { await act(async () => { - render(); + render( {}} />); }); expect(screen.queryByText("Ranking")).toBeInTheDocument(); @@ -100,7 +100,7 @@ describe('RankingList', () => { test('show ranking table with content', async () => { await act(async () => { - render(); + render( {}} />); }); const rows = await screen.findAllByRole('row'); @@ -109,7 +109,7 @@ describe('RankingList', () => { test('show users ordered by "porcentajeAciertos" BY DEFAULT correctly', async () => { await act(async () => { - render(); + render( {}} />); }); // We wait for the users to be loaded and the table to be updated @@ -125,7 +125,7 @@ describe('RankingList', () => { test('show users ordered by "username" correctly', async () => { await act(async () => { - render(); + render( {}} />); }); const usernameHeader = screen.getByRole('columnheader', { name: /Nombre de Usuario/i }); @@ -159,7 +159,7 @@ describe('RankingList', () => { test('show users ordered by "porcentajeAciertos" correctly', async () => { await act(async () => { - render(); + render( {}} />); }); const porcentajeAciertosHeader = screen.getByRole('columnheader', { name: /Porcentaje de Aciertos/i }); @@ -193,7 +193,7 @@ describe('RankingList', () => { test('show users ordered by "preguntasCorrectas" correctly', async () => { await act(async () => { - render(); + render( {}} />); }); const preguntasCorrectasHeader = screen.getByRole('columnheader', { name: /Preguntas Correctas/i }); @@ -226,7 +226,7 @@ describe('RankingList', () => { test('show users ordered by "preguntasFalladas" correctly', async () => { await act(async () => { - render(); + render( {}} />); }); const preguntasFalladasHeader = screen.getByRole('columnheader', { name: /Preguntas Falladas/i }); @@ -259,7 +259,7 @@ describe('RankingList', () => { test('show users ordered by "numeroPartidas" correctly', async () => { await act(async () => { - render(); + render( {}} />); }); const numPartidasHeader = screen.getByRole('columnheader', { name: /NĂºmero de Partidas/i }); diff --git a/webapp/src/components/RecordList.test.js b/webapp/src/components/RecordList.test.js index f7ea2c02..60871daa 100644 --- a/webapp/src/components/RecordList.test.js +++ b/webapp/src/components/RecordList.test.js @@ -29,7 +29,7 @@ describe('RecordList', () => { }); it('renders record list correctly', async () => { - const { getByText } = render(); + const { getByText } = render( {}} username="testuser" />); await waitFor(() => { expect(getByText('Tu historial de jugadas')).toBeInTheDocument(); diff --git a/webapp/src/components/UsersList.test.js b/webapp/src/components/UsersList.test.js index 9d165f3c..84561cc3 100644 --- a/webapp/src/components/UsersList.test.js +++ b/webapp/src/components/UsersList.test.js @@ -36,7 +36,7 @@ describe('UsersList', () => { it('renders headers list correctly', async () => { await act(async () => { - render(); + render( {}} />); }); // Check if the table headers are in the document @@ -49,7 +49,7 @@ describe('UsersList', () => { it('renders all the users rows', async () => { await act(async () => { - render(); + render( {}} />); }); // Check if the table rows are in the document const tableRows = screen.getAllByRole('row'); @@ -58,7 +58,7 @@ describe('UsersList', () => { it('should order users by username correctly', async () => { await act(async () => { - render(); + render( {}} />); }); // We click the username header to order the users by username @@ -92,7 +92,7 @@ describe('UsersList', () => { it('should order users by createdAt date correctly', async () => { await act(async () => { - render(); + render( {}} />); }); // We click the username header to order the users by username