diff --git a/webapp/src/components/FirstGame.js b/webapp/src/components/FirstGame.js index 8c84f77b..aa7f9571 100644 --- a/webapp/src/components/FirstGame.js +++ b/webapp/src/components/FirstGame.js @@ -35,13 +35,8 @@ const Quiz = () => { setRemTime((progress) => { if(progress == 100){ newQuestion(); - //getQuestions() - //repetir checkAndswer return 0; } - // const diff = Math.random() * 10; - // return Math.min(progress + diff, 100); - const diff = crypto.getRandomValues(new Uint32Array(1))[0] % 11; // Generate a random number between 0 and 10 return Math.min(progress + diff, 100); }); @@ -209,6 +204,7 @@ const Quiz = () => { currentQuestionIndex = (currentQuestionIndex + 1); } isCorrect = (false) + setRemTime(0) changeButtons("false") @@ -219,7 +215,6 @@ const Quiz = () => { haveFailedQuestion = false; navigator('/menu') } - }; return ( diff --git a/webapp/src/components/Menu.test.js b/webapp/src/components/Menu.test.js index a14145fb..23dfbab2 100644 --- a/webapp/src/components/Menu.test.js +++ b/webapp/src/components/Menu.test.js @@ -3,7 +3,7 @@ import { ContextFun } from './Context'; import axios from 'axios'; import MockAdapter from 'axios-mock-adapter'; import { BrowserRouter as Router } from 'react-router-dom'; -import { Menu } from './Menu'; +import Menu from './Menu'; const mockAxios = new MockAdapter(axios); @@ -14,9 +14,8 @@ describe("Menu component", () => { }); test("renders menu",async () => { - render( -
+ ); const linkElement = screen.getByText(/Cómo jugar/i);