Align BGS tutorial metadata with checkpoint versions

This commit is contained in:
coyotte508 2026-10-31 18:16:26 +01:00
commit 5439cf41dc
2 changed files with 76 additions and 3 deletions

View file

@ -236,14 +236,74 @@
"name": "new-frontier",
"label": "The New Frontier"
}
]
],
"tutorial": {
"chapters": [
{
"id": "basics",
"version": 3,
"title": "Commencer ici : programmer les tours",
"description": "Start here: planning turns"
},
{
"id": "first-shot",
"version": 2,
"title": "Votre premier tir",
"description": "Your first shot"
},
{
"id": "energy",
"version": 2,
"title": "Énergie et coordination",
"description": "Energy and coordination"
},
{
"id": "repairs",
"version": 2,
"title": "Réparer une panne",
"description": "Repairing a malfunction"
},
{
"id": "battlebots",
"version": 2,
"title": "Robots et intercepteurs",
"description": "Battlebots and interceptors"
},
{
"id": "double-actions",
"version": 2,
"title": "Deux actions, dans l’ordre",
"description": "Two actions, in order"
},
{
"id": "phasing",
"version": 2,
"title": "Menaces de l’extension",
"description": "Expansion threats"
},
{
"id": "specializations",
"version": 2,
"title": "Spécialisations",
"description": "Specializations"
}
]
}
},
"metadata": {
"_id": "space-alert",
"slug": "space-alert",
"label": "Space Alert",
"players": [1, 2, 3, 4, 5],
"players": [
1,
2,
3,
4,
5
],
"releaseYear": 2008,
"tags": ["cooperative"]
"tags": [
"cooperative"
]
}
}

View file

@ -76,3 +76,16 @@ for (const route of [["blue", "lift"], ["lift", "blue"], ["blue", "red"], ["red"
t.destroy();
});
}
test("BGS chapter metadata accepts the progress version emitted by every tutorial", async () => {
const { readFile } = await import("node:fs/promises");
const info = JSON.parse(await readFile(new URL("../bgs/gameinfo.json", import.meta.url)));
for (const chapter of info.version.tutorial.chapters) {
let progress;
const tutorial = await createLessonTutorial(chapter.id, { onProgress: value => { progress = value; } });
await tutorial.continue();
assert.equal(progress.id, chapter.id);
assert.equal(progress.version, chapter.version);
tutorial.destroy();
}
});