mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-08-22 18:07:16 +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:
parent
a0aa87329f
commit
7feb88464d
@ -6,9 +6,9 @@ node_js:
|
||||
- "8"
|
||||
- "7"
|
||||
- "6"
|
||||
- "5"
|
||||
- "4"
|
||||
# - "0.12"
|
||||
script:
|
||||
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then bash ./travis/run_on_pull_requests; fi'
|
||||
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash ./travis/run_on_non_pull_requests; fi'
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
cache:
|
||||
|
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user