mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-08-30 22:05:28 +00:00
Tests cases for #56
This commit is contained in:
@@ -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 () {
|
||||
|
Reference in New Issue
Block a user