2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-30 22:05:28 +00:00

test: Fix test for TelegramBot#setChatDescription()

Bug:

  We MUST ensure we update the description. If the description
  is unchanged, an error is thrown by the API.

Fix:

  Append a random number to the description.
This commit is contained in:
GochoMugo
2017-07-05 11:38:39 +03:00
parent 96b90c2d56
commit 8ed0a2dcef

View File

@@ -887,7 +887,9 @@ describe('TelegramBot', function telegramSuite() {
utils.handleRatelimit(bot, 'setChatDescription', this);
});
it('should set the chat description', function test() {
return bot.setChatDescription(GROUPID, 'node-telegram-bot-api test group').then(resp => {
const random = Math.floor(Math.random() * 1000);
const description = `node-telegram-bot-api test group (random: ${random})`;
return bot.setChatDescription(GROUPID, description).then(resp => {
assert.equal(resp, true);
});
});