{"size": 1343, "ext": "js", "max_stars_repo_path": "dist/source/middleware-helper.is-action.test.js", "max_stars_repo_name": "addap/telegraf-inline-menu", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "dist/source/middleware-helper.is-action.test.js", "max_issues_repo_name": "addap/telegraf-inline-menu", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "dist/source/middleware-helper.is-action.test.js", "max_forks_repo_name": "addap/telegraf-inline-menu", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 43.3225806452, "max_line_length": 107, "alphanum_fraction": 0.6693968727}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const ava_1 = require("ava");
const telegraf_1 = require("telegraf");
const action_code_1 = require("./action-code");
const middleware_helper_1 = require("./middleware-helper");
ava_1.default('correct callbackQuery', async (t) => {
    const bot = new telegraf_1.default('');
    bot.use(async (ctx) => {
        const middleware = middleware_helper_1.isCallbackQueryActionFunc(new action_code_1.default('a:b'));
        t.true(await middleware(ctx));
    });
    await bot.handleUpdate({ callback_query: { data: 'a:b' } });
});
ava_1.default('wrong callbackQuery', async (t) => {
    const bot = new telegraf_1.default('');
    bot.use(async (ctx) => {
        const middleware = middleware_helper_1.isCallbackQueryActionFunc(new action_code_1.default('a:b'));
        t.false(await middleware(ctx));
    });
    await bot.handleUpdate({ callback_query: { data: 'a:c' } });
});
ava_1.default('no callbackQuery', async (t) => {
    const bot = new telegraf_1.default('');
    bot.use(async (ctx) => {
        const middleware = middleware_helper_1.isCallbackQueryActionFunc(new action_code_1.default('a:b'));
        t.false(await middleware(ctx));
    });
    await bot.handleUpdate({ message: {} });
});
//# sourceMappingURL=middleware-helper.is-action.test.js.map