File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -349,6 +349,31 @@ describe("lib/mailtrap-client: ", () => {
349
349
} ) ;
350
350
351
351
describe ( "batch sending:" , ( ) => {
352
+ it ( "throws MailtrapError(TEST_INBOX_ID_MISSING) when batch sending in sandbox mode without testInboxId" , async ( ) => {
353
+ const client = new MailtrapClient ( {
354
+ token : "MY_API_TOKEN" ,
355
+ sandbox : true ,
356
+ accountId : 123 ,
357
+ } ) ;
358
+
359
+ const batchData = {
360
+ base : {
361
+ from : { email : "a@b.com" , name : "Sender" } ,
362
+ subject : "Test" ,
363
+ text : "Body" ,
364
+ } ,
365
+ requests : [
366
+ {
367
+ to : [ { email : "c@d.com" } ] ,
368
+ } ,
369
+ ] ,
370
+ } ;
371
+
372
+ await expect ( client . batchSend ( batchData ) ) . rejects . toEqual (
373
+ new MailtrapError ( TEST_INBOX_ID_MISSING )
374
+ ) ;
375
+ } ) ;
376
+
352
377
it ( "rejects with Mailtrap error when bulk and sandbox modes are used together" , async ( ) => {
353
378
const batchClient = new MailtrapClient ( {
354
379
token : "MY_API_TOKEN" ,
You can’t perform that action at this time.
0 commit comments