diff --git a/test/telegram.js b/test/telegram.js index 7a5b89a..9c390dc 100644 --- a/test/telegram.js +++ b/test/telegram.js @@ -522,6 +522,13 @@ describe('TelegramBot', function telegramSuite() { assert.ok(is.object(resp.document)); }); }); + it('should send a document with custom file options', function test() { + const document = fs.createReadStream(`${__dirname}/data/photo.gif`); + const fileOpts = { filename: 'customfilename.gif' }; + return bot.sendDocument(USERID, document, {}, fileOpts).then(resp => { + assert.equal(resp.document.file_name, fileOpts.filename); + }); + }); }); describe('#sendSticker', function sendStickerSuite() {