mirror of https://github.com/zulip/zulip.git
statis/js/bot_data.js: Add `get_bot_owner_email` function.
This commit is contained in:
parent
a394778cde
commit
5759d5a762
|
@ -45,6 +45,7 @@ run_test('test_basics', () => {
|
|||
full_name: 'Embedded bot 1',
|
||||
services: [{config_data: {key: '12345678'},
|
||||
service_name: "giphy"}],
|
||||
owner: 'cordelia@zulip.com',
|
||||
};
|
||||
|
||||
(function test_add() {
|
||||
|
@ -156,4 +157,11 @@ run_test('test_basics', () => {
|
|||
assert.equal(bots[0].email, 'bot1@zulip.com');
|
||||
assert.equal(bots[1].email, 'bot2@zulip.com');
|
||||
}());
|
||||
|
||||
(function test_get_bot_owner_email() {
|
||||
let bot_owner_email = bot_data.get_bot_owner_email(test_embedded_bot.user_id);
|
||||
assert.equal('cordelia@zulip.com', bot_owner_email);
|
||||
bot_owner_email = bot_data.get_bot_owner_email(test_bot.user_id);
|
||||
assert.equal(undefined, bot_owner_email);
|
||||
}());
|
||||
});
|
||||
|
|
|
@ -77,6 +77,10 @@ var bot_data = (function () {
|
|||
return bots[bot_id];
|
||||
};
|
||||
|
||||
exports.get_bot_owner_email = function (bot_id) {
|
||||
return bots[bot_id].owner;
|
||||
};
|
||||
|
||||
exports.get_services = function bot_data__get_services(bot_id) {
|
||||
return services[bot_id];
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue