2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-29 05:17:41 +00:00

test: Add test for TelegramBot#sendDocument() using 'fileOpts' param

References:

  * Original PR: https://github.com/yagop/node-telegram-bot-api/pull/152
  * Original Author: @evolun
This commit is contained in:
GochoMugo 2017-02-03 10:47:41 +03:00
parent 9d12bdfa41
commit 14f37c7181
No known key found for this signature in database
GPG Key ID: 7B6A01CB57AA39E4

View File

@ -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() {