changement
This commit is contained in:
@@ -87,6 +87,11 @@ describe("VERIFICATION DES 3 CORRECTIFS DE PHASE", () => {
|
||||
log("phase :", vue.body.gameWindow.phase, "| participations ouvertes :", vue.body.gameWindow.isParticipationOpen);
|
||||
expect(vue.body.gameWindow.phase).toBe("NOT_CONFIGURED");
|
||||
|
||||
// Route publique de la page d'accueil : sans configuration, pas de date,
|
||||
// le front affiche alors les dates par défaut.
|
||||
const publique = await request(app).get("/api/game/window").expect(200);
|
||||
expect(publique.body).toMatchObject({ configured: false, startDate: null });
|
||||
|
||||
const essai = await request(app).post("/api/game/participate").set("Authorization", "Bearer " + ctx.tClient).send({ code: CODES[0] });
|
||||
log("un client tente de jouer ->", essai.status, essai.body.message);
|
||||
expect(essai.status).toBe(410);
|
||||
@@ -108,6 +113,12 @@ describe("VERIFICATION DES 3 CORRECTIFS DE PHASE", () => {
|
||||
log("PUT game-settings ->", r.status, "| phase :", r.body.gameWindow.phase);
|
||||
expect(r.body.gameWindow.phase).toBe("SCHEDULED");
|
||||
|
||||
// La page d'accueil reçoit aussitôt la nouvelle date, sans authentification.
|
||||
const publique = await request(app).get("/api/game/window").expect(200);
|
||||
expect(publique.body.configured).toBe(true);
|
||||
expect(publique.body.startDate).toBe(futur);
|
||||
expect(new Date(publique.body.participationDeadline).getTime()).toBe(new Date(futur).getTime() + 30 * DAY);
|
||||
|
||||
const anticipe = await request(app).post("/api/game/participate").set("Authorization", "Bearer " + ctx.tClient).send({ code: CODES[0] });
|
||||
log("client joue avant ouverture ->", anticipe.status);
|
||||
log("message :", JSON.stringify(anticipe.body.message));
|
||||
|
||||
Reference in New Issue
Block a user