UNPKG

vvlad1973-telegram-framework

Version:
81 lines (56 loc) 2.35 kB
'use strict' import assert from 'assert'; import { BotCommandScopeDefault, BotCommandScopeAllPrivateChats, BotCommandScopeAllGroupChats, BotCommandScopeAllChatAdministrators, BotCommandScopeChat, BotCommandScopeChatAdministrators, BotCommandScopeChatMember } from '../classes/bot-commands-scope.js'; import { BotCommandScopeTypes } from '../classes/enums.js'; describe/* .skip */('Tests for classes BotCommandsScope', () => { it('Test class BotCommandScopeDefault', () => { let item = new BotCommandScopeDefault(); console.log(JSON.stringify(item)); assert.equal(item.type, BotCommandScopeTypes.DEFAULT); }); it('Test class BotCommandScopeAllPrivateChats', () => { let item = new BotCommandScopeAllPrivateChats(); console.log(JSON.stringify(item)); assert.equal(item.type, BotCommandScopeTypes.ALL_PRIVATE_CHATS); }); it('Test class BotCommandScopeAllGroupChats', () => { let item = new BotCommandScopeAllGroupChats(); console.log(JSON.stringify(item)); assert.equal(item.type, BotCommandScopeTypes.ALL_GROUP_CHATS); }); it('Test class BotCommandScopeAllChatAdministrators', () => { let item = new BotCommandScopeAllChatAdministrators(); console.log(JSON.stringify(item)); assert.equal(item.type, BotCommandScopeTypes.ALL_CHAT_ADMINISTRATORS); }); it('Test class BotCommandScopeChat', () => { let chatId = 99999, item = new BotCommandScopeChat(chatId); console.log(JSON.stringify(item)); assert.equal(item.type, BotCommandScopeTypes.CHAT); assert.equal(item.chat_id, chatId); }); it('Test class BotCommandScopeChatAdministrators', () => { let chatId = 99999, item = new BotCommandScopeChatAdministrators(chatId); console.log(JSON.stringify(item)); assert.equal(item.type, BotCommandScopeTypes.CHAT_ADMINISTRATORS); assert.equal(item.chat_id, chatId); }); it('Test class BotCommandScopeChatMember', () => { let chatId = 99999, userId = 77777, item = new BotCommandScopeChatMember(chatId, userId); console.log(JSON.stringify(item)); assert.equal(item.type, BotCommandScopeTypes.CHAT_MEMBER); assert.equal(item.chat_id, chatId); assert.equal(item.user_id, userId); }); });