Skip to content

Commit

Permalink
Test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
UO287747 committed Feb 28, 2024
1 parent 0f1593d commit 8195ff0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions webapp/src/test/Participation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,16 @@ describe('Participation component', () => {
const titleText = screen.getByText(/Participation/i);
expect(titleText).toBeInTheDocument();

// Verificar que el botón "Menu" se muestra correctamente
const menuButton = screen.getByRole('button', { name: /Menu/i });
expect(menuButton).toBeInTheDocument();
});

test('clicking "Menu" button calls goTo function with correct argument', () => {
const goToMock = jest.fn();
render(<Participation goTo={goToMock} />);

// Simular clic en el botón "Menu"
fireEvent.click(screen.getByText('Menu'));
fireEvent.click(screen.getByText('Volver al Menú'));

// Verificar que la función goTo se llamó con el argumento correcto (en este caso, 0)
expect(goToMock).toHaveBeenCalledWith(0);
// Verificar que la función goTo se llamó con el argumento correcto (en este caso, 1)
expect(goToMock).toHaveBeenCalledWith(1);
});
});

0 comments on commit 8195ff0

Please sign in to comment.