|
|
|
|
@ -368,6 +368,32 @@ describe('Telegram', function () { |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
describe('#getFile', function () { |
|
|
|
|
var fileId; |
|
|
|
|
|
|
|
|
|
// To get a file we have to send any file first
|
|
|
|
|
it('should send a photo from file', function (done) { |
|
|
|
|
var bot = new Telegram(TOKEN); |
|
|
|
|
var photo = __dirname + '/bot.gif'; |
|
|
|
|
bot.sendPhoto(USERID, photo).then(function (resp) { |
|
|
|
|
resp.should.be.an.instanceOf(Object); |
|
|
|
|
fileId = resp.photo[0].file_id; |
|
|
|
|
done(); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('should get a file', function (done) { |
|
|
|
|
|
|
|
|
|
var bot = new Telegram(TOKEN); |
|
|
|
|
|
|
|
|
|
bot.getFile(fileId).then(function (resp) { |
|
|
|
|
resp.should.be.an.instanceOf(Object); |
|
|
|
|
resp.file_path.should.be.an.instanceOf(String); |
|
|
|
|
done(); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}); // End Telegram
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|