Completa la copertura test di tutti i badge e corregge due bug trovati in audit

Audit dedicato su tutti i 16 badge: s-tiebreak non applicava la soglia minima di
voti pagella di Pagellone sullo stesso campo mediaVoto (corretto), s-cacche
prometteva "partite di campionato" senza che il codice lo verificasse mai
(corretta la descrizione, comportamento invariato). Aggiunti test unit e
integration end-to-end mancanti su badge segreti e social, con dati scritti a
database anche per i cinque segreti che prima ne erano privi.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-08 15:36:33 +02:00
co-authored by Claude Sonnet 5
parent a451d4187f
commit 3b305b0f8e
15 changed files with 1230 additions and 41 deletions
+17 -2
View File
@@ -117,8 +117,23 @@ if (!locale) {
[`${PREFISSO}-m7`, "2020-01-07", "pv1"],
] as const;
for (const [id, data] of eventi) await creaEvento(id, data);
for (const [id, , giocatore] of eventi) if (giocatore) await confermaTurno(id, giocatore);
for (const [id, data] of eventi.slice(0, 3)) await creaEvento(id, data);
for (const [id, , giocatore] of eventi.slice(0, 3))
if (giocatore) await confermaTurno(id, giocatore);
const eventiA3 = await leggiEventi();
const salvatiA3 = await leggiTurniSalvati();
const conteggioA3 = conteggioTurni(salvatiA3, eventiA3, OGGI);
assert.equal(conteggioA3["pv1"], 3, "3 turni confermati: soglia bronzo appena raggiunta");
assert.equal(
statoBadge(palloniDef, giocatoreAzzerato(conteggioA3["pv1"]!)).grado,
"bronzo",
"3 turni: bronzo, non oltre (soglia argento è 6)",
);
for (const [id, data] of eventi.slice(3)) await creaEvento(id, data);
for (const [id, , giocatore] of eventi.slice(3))
if (giocatore) await confermaTurno(id, giocatore);
const eventiLetti = await leggiEventi();
assert.equal(eventiLetti.length, 7, "tutti gli eventi scritti si rileggono");