Skip to content

Commit

Permalink
Continue with problems
Browse files Browse the repository at this point in the history
  • Loading branch information
lauratbg committed Apr 25, 2024
1 parent 1137ee1 commit e282d78
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions webapp/src/components/questionView/QuestionView.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ describe('Question View component', () => {
expect(correctAnswerButton).toHaveStyle('background-color: #6EF26E');
}, { timeout: 1000 }); // Esperar 1 segundo
});

it('shows colors to reveal false answer and it sounds', async () => {
setupAudioMock()
await act(async () =>{
Expand All @@ -130,7 +131,7 @@ describe('Question View component', () => {
}, { timeout: 1000 }); // Esperar 1 segundo
});

it('shows timer ', async () => {
it('shows timer', async () => {
setupAudioMock()
await act(async () =>{
await render(<MemoryRouter><QuestionView /></MemoryRouter>);
Expand All @@ -139,7 +140,7 @@ describe('Question View component', () => {
await waitFor(() => expect(screen.getByText('What is the population of Oviedo?')).toBeInTheDocument());
// expect(global.Audio).toHaveBeenCalledWith('/tictac.mp3');

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

Expand Down Expand Up @@ -171,7 +172,7 @@ describe('Question View component', () => {
// })
// await waitFor(() => expect(screen.getByText('What is the population of Oviedo?')).toBeInTheDocument());

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


Expand Down

0 comments on commit e282d78

Please sign in to comment.