From 8ed0a2dcef7c5892da303814df5c86027efabb72 Mon Sep 17 00:00:00 2001 From: GochoMugo Date: Wed, 5 Jul 2017 11:38:39 +0300 Subject: [PATCH] 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. --- test/telegram.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/telegram.js b/test/telegram.js index d45f4ca..a087423 100644 --- a/test/telegram.js +++ b/test/telegram.js @@ -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); }); });