2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-30 13:58:27 +00:00

Tests cases for #56

This commit is contained in:
Yago 2016-01-03 12:54:45 +01:00
parent b46ea1d9a6
commit fd4cf4e353

View File

@ -197,6 +197,15 @@ describe('Telegram', function () {
done();
});
});
it('should send a photo from a Buffer', function (done) {
var bot = new Telegram(TOKEN);
var photo = fs.readFileSync(__dirname+'/bot.gif');
bot.sendPhoto(USERID, photo).then(function (resp) {
resp.should.be.an.instanceOf(Object);
done();
});
});
});
describe('#sendChatAction', function () {
@ -260,6 +269,15 @@ describe('Telegram', function () {
done();
});
});
it('should send a document from a Buffer', function (done) {
var bot = new Telegram(TOKEN);
var document = fs.readFileSync(__dirname+'/bot.gif');
bot.sendDocument(USERID, document).then(function (resp) {
resp.should.be.an.instanceOf(Object);
done();
});
});
});
describe('#sendSticker', function () {
@ -300,6 +318,15 @@ describe('Telegram', function () {
done();
});
});
it('should send a sticker from a Buffer', function (done) {
var bot = new Telegram(TOKEN);
var sticker = fs.readFileSync(__dirname+'/sticker.webp');
bot.sendDocument(USERID, sticker).then(function (resp) {
resp.should.be.an.instanceOf(Object);
done();
});
});
});
describe('#sendVideo', function () {