2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-31 06:16:07 +00:00

test: update test suite

- remove unecessary tests for node v5 and below
- fix tg side errors when running tests i.e. currency format
- enable force builds on pr
This commit is contained in:
Mohammed Sohail
2019-10-15 15:03:20 +05:30
parent a0aa87329f
commit 7feb88464d
2 changed files with 18 additions and 6 deletions

View File

@@ -1057,7 +1057,13 @@ describe('TelegramBot', function telegramSuite() {
return bot.sendLocation(USERID, lat, long, opts).then(resp => { message = resp; });
});
it('edits live location', function test() {
const opts = { chat_id: USERID, message_id: message.message_id };
const replyMarkup = JSON.stringify({
inline_keyboard: [[{
text: 'Test button',
callback_data: 'test'
}]]
});
const opts = { chat_id: USERID, message_id: message.message_id, reply_markup: replyMarkup };
return bot.editMessageLiveLocation(lat + 1, long + 1, opts).then(resp => {
assert.ok(is.object(resp));
assert.ok(is.object(resp.location));
@@ -1074,7 +1080,13 @@ describe('TelegramBot', function telegramSuite() {
return bot.sendLocation(USERID, lat, long, { live_period: 86400 })
.then((resp) => {
message = resp;
const opts = { chat_id: USERID, message_id: message.message_id };
const replyMarkup = JSON.stringify({
inline_keyboard: [[{
text: 'Test button',
callback_data: 'test'
}]]
});
const opts = { chat_id: USERID, message_id: message.message_id, reply_markup: replyMarkup };
return bot.editMessageLiveLocation(lat + 1, long + 1, opts);
});
});
@@ -1367,7 +1379,7 @@ describe('TelegramBot', function telegramSuite() {
const payload = 'sku-p001';
const providerToken = PROVIDER_TOKEN;
const startParameter = 'pay';
const currency = 'KES';
const currency = 'USD';
const prices = [{ label: 'product', amount: 11000 }, { label: 'tax', amount: 11000 }];
return bot.sendInvoice(USERID, title, description, payload, providerToken, startParameter, currency, prices).then(resp => {
assert.ok(is.object(resp));