test(email): add structural guard for shared email partials
This commit is contained in:
@@ -341,7 +341,7 @@ Cheap catch for future drift, and the **gate** for Tasks 6–9. 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
|
||||
|
||||
Reference in New Issue
Block a user