Skip to content

Commit

Permalink
Removing things
Browse files Browse the repository at this point in the history
  • Loading branch information
lauratbg committed Apr 17, 2024
1 parent 2248399 commit 2ec2f25
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
5 changes: 1 addition & 4 deletions webapp/src/components/questionView/QuestionView.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,8 @@ function QuestionComponent({questions, numQuestion, handleClick, t, points, audi

speech.addEventListener("end", () => {
const voices = window.speechSynthesis.getVoices();
if (voices.length > 0) {
if (voices.length > 0)
resolve(voices);
} else {
reject("No se encontraron voces disponibles.");
}
});

window.speechSynthesis.speak(speech);
Expand Down
21 changes: 21 additions & 0 deletions webapp/src/components/questionView/QuestionView.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ configure({
});

const mockAxios = new MockAdapter(axios);
jest.setTimeout(10000);


i18en.use(initReactI18next).init({
Expand Down Expand Up @@ -160,5 +161,25 @@ describe('Question View component', () => {
});


// it('renders end message when countdown completes', async() => {

// setupAudioMock()
// mockAxios.onGet('http://localhost:8000/questions/en').reply(200,
// [{question: "What is the population of Oviedo?",
// answers: ["225089","272357","267855","231841"]}]);
// await act(async () =>{
// await render(<UserContextProvider><MemoryRouter><QuestionView /></MemoryRouter></UserContextProvider>);

// })
// await waitFor(() => expect(screen.getByText('What is the population of Oviedo?')).toBeInTheDocument());

// const timerElement = screen.getByText(new RegExp(`(\\d+) ${i18en.t('questionView.seconds')}`));
// expect(timerElement).toBeInTheDocument(); // Verificar que el temporizador esté presente en el DOM


// await waitFor(() => {
// expect(screen.getByText("Time's up!")).toBeInTheDocument();
// }, { timeout: 9800 }); // Esperar 10 segundos
// });

});

0 comments on commit 2ec2f25

Please sign in to comment.