Skip to content

Commit

Permalink
#1459 Add a failing test for attachments with null content (#1466)
Browse files Browse the repository at this point in the history
Co-authored-by: negrita_kalcheva <negrita.kalcheva@netbuilder.com>
  • Loading branch information
kalchevanegrita2 and negrita_kalcheva committed Sep 23, 2022
1 parent 6f40536 commit 0a52eeb
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/mail-composer/mail-composer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -881,5 +881,34 @@ describe('MailComposer unit tests', function () {
done();
});
});


it('should throw an error if any attachment has null content', function (done) {
let data = {
text: 'abc',
baseBoundary: 'test',
messageId: 'zzzzzz',
date: 'Sat, 21 Jun 2014 10:52:44 +0000',
attachments: [
{
headers: {
'X-Test-1': 12345,
'X-Test-2': 'ÕÄÖÜ',
'X-Test-3': ['foo', 'bar']
},
content: null,
filename: 'test.txt',
contentTransferEncoding: false
}
]
};


let mail = new MailComposer(data).compile();
mail.build(function (err) {
expect(err).to.exist;
done();
});
});
});
});

0 comments on commit 0a52eeb

Please sign in to comment.