diff --git a/tests/brief-outbox.test.mjs b/tests/brief-outbox.test.mjs index 3bcdb32..52c006a 100644 --- a/tests/brief-outbox.test.mjs +++ b/tests/brief-outbox.test.mjs @@ -22,6 +22,12 @@ function sender(outbox, overrides={}) { sendEmail:async()=>({id:'synthetic-receipt'}),warn:()=>{},...overrides}); } +test('invalid weekly manifest is rejected before it reaches the queue', t=>{ + const {outbox}=fixture(t); + assert.throws(()=>outbox.prepare('2026-09-07','bad@example.test',{channel:'email'}),/manifesti bozuk/); + assert.throws(()=>outbox.prepare('2026-09-07','bad@example.test',[{to:{email:'bad'}}]),/manifesti bozuk/); +}); + test('accepted delivery survives reopening and does not send again; weeks and owners are isolated',async t=>{ const {outbox,directory}=fixture(t);let calls=0; const transport={sendEmail:async()=>{calls++;return {id:'receipt'};}};