Skip to content

Commit

Permalink
espero que sea el ultimo
Browse files Browse the repository at this point in the history
  • Loading branch information
bidof committed May 1, 2024
1 parent 91eecb0 commit 9822b13
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
32 changes: 18 additions & 14 deletions webapp/src/components/game/gameModes/DailyGameMode.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,7 @@ class DailyGameMode extends BasicGame{
}

async volverAJugarCoockie(){
Swal.fire({
title: i18n.t('basicGameEnd'),
html: `
<p>: ${i18n.t('correctAnswers')} ${this.correctas}</p>
`,
confirmButtonText: i18n.t('close'),
customClass: {
popup: 'finDelJuego'
}
}).then(()=>{

this.navigate('/home');

});
this.imprimirPopUP();

// Obtener la fecha actual y establecer la hora a las 12 de la noche
let expiryDate = new Date();
Expand Down Expand Up @@ -160,6 +147,23 @@ class DailyGameMode extends BasicGame{
console.error('Error enviando los datos de diaria del usuario:', error);
}
}

imprimirPopUP(){
Swal.fire({
title: i18n.t('basicGameEnd'),
html: `
<p>: ${i18n.t('correctAnswers')} ${this.correctas}</p>
`,
confirmButtonText: i18n.t('close'),
customClass: {
popup: 'finDelJuego'
}
}).then(()=>{

this.navigate('/home');

});
}

fechaActual(){
const fecha = new Date(); // Obtenemos la fecha actual
Expand Down
13 changes: 9 additions & 4 deletions webapp/src/components/game/gameModes/DailyGameMode.test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import DailyGameMode from './DailyGameMode';
import axios from 'axios';
import { render } from '@testing-library/react';
import { BrowserRouter as Router } from 'react-router-dom';
import { AuthContext } from '../../authcontext';
import { ThemeProvider,createTheme } from '@mui/material/styles';
import { createTheme } from '@mui/material/styles';

jest.mock('i18next', () => ({
t: jest.fn(),
}));
jest.mock('axios');
describe('DailyGameMode', () => {
let dailyGameMode;
Expand All @@ -21,8 +21,13 @@ describe('DailyGameMode', () => {
});
beforeEach(() => {
dailyGameMode = new DailyGameMode();
dailyGameMode.imprimirPopUP = jest.fn();


});



afterEach(() => {
jest.clearAllMocks();
});
Expand Down

0 comments on commit 9822b13

Please sign in to comment.