fix: icones manquantes dans la table des matieres de la configuration (BUG-066)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user