mirror of
https://github.com/deunix-educ/PyQuest.git
synced 2026-11-25 08:19:44 +01:00
Add graphical progress map and illustrated badges shelf
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
// Chaque badge existant a son illustration et ses textes (nom, condition) en français et en anglais.
|
||||
import { readFileSync } from 'node:fs';
|
||||
import assert from 'node:assert';
|
||||
import { ProgressStore } from '../../app/js/core/ProgressStore.js';
|
||||
import { BADGE_ICON_IDS } from '../../app/js/ui/badgeArt.js';
|
||||
|
||||
const dir = new URL('../../app/js/i18n/', import.meta.url);
|
||||
const catalogs = { fr: JSON.parse(readFileSync(new URL('fr.json', dir), 'utf8')), en: JSON.parse(readFileSync(new URL('en.json', dir), 'utf8')) };
|
||||
|
||||
assert.ok(ProgressStore.badgeIds.length >= 5);
|
||||
assert.deepEqual([...BADGE_ICON_IDS].sort(), [...ProgressStore.badgeIds].sort(), 'illustration ⇔ badge');
|
||||
for (const id of ProgressStore.badgeIds) {
|
||||
for (const [lang, catalog] of Object.entries(catalogs)) {
|
||||
assert.ok(catalog[`badge.${id}`]?.trim(), `${lang} : nom du badge ${id}`);
|
||||
assert.ok(catalog[`badge.${id}.desc`]?.trim(), `${lang} : condition du badge ${id}`);
|
||||
}
|
||||
}
|
||||
console.log('badges ok');
|
||||
Reference in New Issue
Block a user