test(email): add structural guard for shared email partials

This commit is contained in:
2026-06-26 23:28:43 +02:00
parent bf5c710c2b
commit 7f2f7810fe
3 changed files with 33 additions and 3 deletions
@@ -341,7 +341,7 @@ Cheap catch for future drift, and the **gate** for Tasks 69. No test framewor
**Interfaces:**
- Produces: a script that exits non-zero if any `email/*.html` (excluding `partials/`) is missing a header IMPORT, footer IMPORT, or `<!-- preheader -->` marker. Run after every template conversion.
- [ ] **Step 1: Write the script**
- [x] **Step 1: Write the script**
```js
#!/usr/bin/env node
@@ -372,12 +372,12 @@ if (failures.length) {
console.log(`Email template check passed (${files.length} templates).`);
```
- [ ] **Step 2: Run it — expect failures for every not-yet-converted template, pass for `reset.html`**
- [x] **Step 2: Run it — expect failures for every not-yet-converted template, pass for `reset.html`**
Run: `node scripts/check-emails.js`
Expected: FAIL, listing `welcome.html`, `verify-email.html`, `reset_notify.html`, `registration_accepted.html`, `invitation.html`, `banned.html`, `test.html`, `notification.html`, `digest.html` (reset.html absent from the list). This proves the guard discriminates.
- [ ] **Step 3: Commit**
- [x] **Step 3: Commit**
```bash
git add scripts/check-emails.js