feat(entree): « en construction » et « Proposer une ressource » (B13b-M6)

Tant que le slot de matière de SectionEchelle est vide (B15 et B16 non
construits), la porte dit « Cette échelle est en construction. » suivi
d'un bouton secondaire (contour) « Proposer une ressource » vers
/proposer?categorie=<categorieProposer>, avec le repli de M4. Condition sur
le slot, pas sur un drapeau. Textes et lien dans echelles.ts
(PORTE_EN_CONSTRUCTION, lienProposer) ; le test vérifie que chaque
catégorie est reconnue par /proposer (TYPES_SUGGERES). 67 → 71 cas.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MYkaR9gSetC8qKAowoMKpM
This commit is contained in:
Jules Neny
2026-10-13 16:20:37 +02:00
co-authored by Claude Opus 5.5
parent 5de7987a2e
commit 19f0db0932
3 changed files with 64 additions and 3 deletions
+10 -1
View File
@@ -20,10 +20,11 @@ const jiti = createJiti(import.meta.url)
const {
ECHELLES, ORDRE_ECHELLES, ECHELLES_CADRE_COURT, echelleDeRoute,
ECHELLES_FLUX, lirePorte, voisines, fermeturePorte,
PORTES_ECHELLES, FUSION_PORTE,
PORTES_ECHELLES, FUSION_PORTE, PORTE_EN_CONSTRUCTION, lienProposer,
} = await jiti.import(
join(__dirname, '..', 'utils', 'echelles.ts'),
)
const { TYPES_SUGGERES } = await jiti.import(join(__dirname, '..', 'utils', 'submitLibre.ts'))
const cases = [
// [path, query, groupe attendu, onglet attendu]
@@ -147,6 +148,14 @@ for (const id of ORDRE_ECHELLES) {
verif(JSON.stringify(got) === JSON.stringify(rangees[id]), `rangée ${id} = ${got.join(' · ')}`)
}
// ── Porte en construction (B13b-M6) : textes dans echelles.ts, lien vers /proposer reconnu ──
verif(PORTE_EN_CONSTRUCTION.texte === 'Cette échelle est en construction.' && PORTE_EN_CONSTRUCTION.proposer === 'Proposer une ressource', 'en construction : les deux textes')
for (const id of ORDRE_ECHELLES) {
const lien = lienProposer(id)
const categorie = new URLSearchParams(lien.split('?')[1]).get('categorie')
verif(lien.startsWith('/proposer?') && TYPES_SUGGERES.includes(categorie), `proposer ${id} → ${lien} (catégorie reconnue par /proposer)`)
}
const total = cases.length + ORDRE_ECHELLES.length + 1 + extra
console.log(`\n${total - fail}/${total}`)
process.exit(fail ? 1 : 0)