Azzera errori di lint e di tipo e corregge il test sugli slot della rosa
- schema-profili: il test pretendeva che lo slot g1 fosse libero, ma in produzione è collegato a un giocatore vero; ora verifica che il tentativo anonimo non cambi il valore. - rosa: il default dei voti MVP era fuori da useMemo e faceva ricalcolare la rosa a ogni render finché i voti non erano caricati. - test dei badge, profili-core, push-sw, scout-stato: tipi allineati al codice (MappaPresenze, nascita da M18, renotify, narrowing di deepEqual). - vite.config: tipizzato come UserConfig e rimosso esbuild.keepNames, ignorato da Vite 8 che non usa più esbuild. - formattazione Prettier in BarraSottosezioni e classifica. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
61d4dacb3a
commit
431530af2a
13 files changed
+56
-44
No files matched your search
@@ -114,6 +114,7 @@ const squadra: GiocatoreSquadra[] = [
|
||||
email: null,
|
||||
numeroTessera: null,
|
||||
dataTessera: null,
|
||||
nascita: null,
|
||||
},
|
||||
{
|
||||
id: "g2",
|
||||
@@ -126,6 +127,7 @@ const squadra: GiocatoreSquadra[] = [
|
||||
email: null,
|
||||
numeroTessera: null,
|
||||
dataTessera: null,
|
||||
nascita: null,
|
||||
},
|
||||
];
|
||||
const csv = csvTesseramento(squadra, { g1: completo });
|
||||
|
||||
@@ -4,11 +4,16 @@ import { readFileSync } from "node:fs";
|
||||
import { runInNewContext } from "node:vm";
|
||||
|
||||
const codice = readFileSync(new URL("../../public/push-sw.js", import.meta.url), "utf8");
|
||||
type Evento = { data?: { json: () => unknown } | null; waitUntil: (p: Promise<unknown>) => void };
|
||||
type Evento = {
|
||||
data?: { json: () => unknown } | null | undefined;
|
||||
waitUntil: (p: Promise<unknown>) => void;
|
||||
};
|
||||
// `renotify` è supportato da Chromium ma manca dai tipi DOM di TypeScript.
|
||||
type OpzioniNotifica = NotificationOptions & { renotify?: boolean };
|
||||
|
||||
function avviaWorker() {
|
||||
const listener = new Map<string, (event: Evento) => void>();
|
||||
const notifiche: Array<{ titolo: string; opzioni: NotificationOptions }> = [];
|
||||
const notifiche: Array<{ titolo: string; opzioni: OpzioniNotifica }> = [];
|
||||
let completa: (() => void) | undefined;
|
||||
const mostrata = new Promise<void>((resolve) => (completa = resolve));
|
||||
const installata = Promise.resolve();
|
||||
@@ -23,7 +28,7 @@ function avviaWorker() {
|
||||
matchAll: () => assert.fail("la push deve funzionare senza consultare finestre aperte"),
|
||||
},
|
||||
registration: {
|
||||
showNotification(titolo: string, opzioni: NotificationOptions) {
|
||||
showNotification(titolo: string, opzioni: OpzioniNotifica) {
|
||||
notifiche.push({ titolo, opzioni });
|
||||
return mostrata;
|
||||
},
|
||||
|
||||
@@ -4,7 +4,8 @@ import { SCOUT_STATO_KEY, statoIniziale } from "@/lib/scout-stato";
|
||||
|
||||
// --- statoIniziale: parte vuoto, con avversario e campo memorizzati -----------
|
||||
const stato = statoIniziale("Avversari", true);
|
||||
assert.deepEqual(stato, { azioni: [], setChiusi: [], avversario: "Avversari", casa: true });
|
||||
// Confronta una copia: deepEqual restringerebbe `stato` al letterale, con `azioni: never[]`.
|
||||
assert.deepEqual({ ...stato }, { azioni: [], setChiusi: [], avversario: "Avversari", casa: true });
|
||||
|
||||
const trasferta = statoIniziale("Altra Squadra", false);
|
||||
assert.equal(trasferta.casa, false);
|
||||
|
||||
Reference in new issue
Block a user