fix: icones manquantes dans la table des matieres de la configuration (BUG-066)
CI / lint (push) Successful in 1m40s
CI / security (push) Successful in 1m4s
CI / test (push) Successful in 3m2s
CI / build (push) Successful in 1m1s
CI / e2e (push) Successful in 11m53s

This commit is contained in:
2026-09-18 10:14:41 -04:00
parent 7e1f5d6852
commit 82f6b4a791
13 changed files with 65 additions and 16 deletions
+33
View File
@@ -189,6 +189,38 @@ function testAdminModuleSyntax() {
console.log(' ✓ admin.js parses without syntax errors');
}
// ── Test config TOC icons ─────────────────────────────────────────────────
const FRONTEND_DIR = join(__dirname, '../../frontend');
const INDEX_HTML = join(FRONTEND_DIR, 'index.html');
const ICON_RE = /^\p{Extended_Pictographic}/u;
function testConfigTocIcons() {
const html = readFileSync(INDEX_HTML, 'utf-8');
const keys = [
...html.matchAll(
/<a\s+href="#cfg-[^"]*"\s+class="help-nav-link"\s+data-i18n="([^"]+)"/g,
),
].map((m) => m[1]);
assert.ok(keys.length > 0, 'config TOC links found in index.html');
for (const lang of ['fr', 'en']) {
const locale = JSON.parse(
readFileSync(join(FRONTEND_DIR, 'locales', `${lang}.json`), 'utf-8'),
);
for (const key of keys) {
const value = locale[key];
assert.ok(value, `${lang}: missing TOC label for ${key}`);
assert.ok(
ICON_RE.test(value),
`${lang}: TOC label for ${key} has no icon ("${value}")`,
);
}
}
console.log(
` ✓ config TOC labels (${keys.length}) all carry an icon in FR and EN`,
);
}
// ── Test ai-fab.js (FAB — Floating Action Button) ─────────────────────────
const AIFAB_PATH = join(JS_DIR, 'ai-fab.js');
@@ -222,6 +254,7 @@ async function main() {
['admin module syntax', testAdminModuleSyntax],
['ai-fab module exists', testAIFabModuleExists],
['ai-fab module exports', testAIFabModuleExports],
['config TOC icons', testConfigTocIcons],
];
for (const [name, fn] of tests) {