diff --git a/webapp/src/components/game/GameConfiguration.js b/webapp/src/components/game/GameConfiguration.js index f764927d..abdb4fbc 100644 --- a/webapp/src/components/game/GameConfiguration.js +++ b/webapp/src/components/game/GameConfiguration.js @@ -12,7 +12,6 @@ const apiEndpoint = process.env.REACT_APP_API_ENDPOINT|| 'http://localhost:8000' let gameId; let questions = [] -const previousBackgroundColor = '#1a1a1a' const GameConfiguration = () => { diff --git a/webapp/src/components/game/GameConfiguration.test.js b/webapp/src/components/game/GameConfiguration.test.js index 86788f68..fe617b25 100644 --- a/webapp/src/components/game/GameConfiguration.test.js +++ b/webapp/src/components/game/GameConfiguration.test.js @@ -98,5 +98,22 @@ describe("Game Configuration", () => { expect(input.value).toBe('5'); }); + test("try to put number of answers < 2",async () => { + + const { getByLabelText } = + render( + + + + + + ); + + const input = getByLabelText('Número de respuestas:'); + fireEvent.change(input, { target: { value: '1' } }); + expect(input.value).toBe('2'); + expect(screen.getAllByText(/El número de respuestas debe ser mayor que 2/i)[0]).toBeInTheDocument(); + }); + });