Completa la copertura test del badge MVP e riscrive la doc del modulo badge
Aggiunge il caso positivo RLS mancante per mvp_voti in permessi.test.ts e un nuovo test end-to-end (mvp-badge.test.ts) che verifica l'intera pipeline voti reali -> mvpVintiPerGiocatore() -> statoBadge(). docs/modules/badge.md ora elenca tutti e 16 i badge con come funzionano, la copertura test badge per badge e i due problemi minori trovati in audit (badgeSbloccati() morta, categoria senza vincolo DB). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -311,6 +311,18 @@ if (!locale) {
|
||||
});
|
||||
assert.ok(!falso.ok, `non si vota a nome di un altro (${falso.status})`);
|
||||
|
||||
const mioMvp = await rest("mvp_voti", tokenGiocatore, {
|
||||
method: "POST",
|
||||
headers: { Prefer: "resolution=merge-duplicates,return=representation" },
|
||||
body: JSON.stringify({
|
||||
match_id: EVENTO,
|
||||
votante_id: "g1",
|
||||
votato_id: "g5",
|
||||
votato_nome: "Cinque",
|
||||
}),
|
||||
});
|
||||
assert.equal(await righeToccate(mioMvp), 1, "il proprio voto MVP si registra");
|
||||
|
||||
const mvp = await rest("mvp_voti", tokenGiocatore, {
|
||||
method: "POST",
|
||||
headers: { Prefer: "resolution=merge-duplicates,return=representation" },
|
||||
|
||||
Reference in New Issue
Block a user