diff --git a/bgs/gameinfo.json b/bgs/gameinfo.json index c167442..d21b97c 100644 --- a/bgs/gameinfo.json +++ b/bgs/gameinfo.json @@ -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" + ] } } diff --git a/test/tutorial-controller.test.js b/test/tutorial-controller.test.js index 9172606..8fdd23d 100644 --- a/test/tutorial-controller.test.js +++ b/test/tutorial-controller.test.js @@ -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(); + } +});