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:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user