Skip to content

Commit

Permalink
added menu checks for the new game
Browse files Browse the repository at this point in the history
  • Loading branch information
uo288574 committed Apr 28, 2024
1 parent 455170b commit f3b51fb
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions webapp/src/components/Menu.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,16 @@ describe("Menu component", () => {
</MemoryRouter>
);

const linkElement = screen.getByText(/Modos de juego:/i);
//Comprobamos que esten todos los elementos
let linkElement = screen.getByText(/Modos de juego:/i);
expect(linkElement).toBeInTheDocument();
});

test("game modes",async () => {
render(
<MemoryRouter>
<Menu />
</MemoryRouter>
);

const gamesBT = document.getElementsByClassName('modes')
expect(gamesBT).toHaveLength(1);
const gamesBT = document.getElementsByClassName('modes')[0].childNodes;
expect(gamesBT).toHaveLength(2);
linkElement = screen.getByText(/Clásico/i);
expect(linkElement).toBeInTheDocument();
linkElement = screen.getByText(/Calculadora Humana/i);
expect(linkElement).toBeInTheDocument();

});

});

0 comments on commit f3b51fb

Please sign in to comment.