mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
Test startup logic in bot_data.js
(imported from commit 6410c584c2e1d8027a276902c67f34ee6a284e6f)
This commit is contained in:
committed by
Leo Franchi
parent
0d0c427f2b
commit
44bb9d58d1
@@ -1,11 +1,15 @@
|
||||
var _ = global._;
|
||||
|
||||
set_global('$', function () {
|
||||
set_global('$', function (f) {
|
||||
if (f) {
|
||||
return f();
|
||||
}
|
||||
return {trigger: function () {}};
|
||||
});
|
||||
set_global('document', null);
|
||||
|
||||
var page_params = {
|
||||
bot_list: [{email: 'bot0@zulip.com', full_name: 'Bot 0'}],
|
||||
is_admin: false,
|
||||
email: 'owner@zulip.com'
|
||||
};
|
||||
@@ -18,6 +22,9 @@ global.patch_builtin('_', patched_underscore);
|
||||
|
||||
var bot_data = require('js/bot_data.js');
|
||||
|
||||
// Our startup logic should have added Bot 0 from page_params.
|
||||
assert.equal(bot_data.get('bot0@zulip.com').full_name, 'Bot 0');
|
||||
|
||||
(function () {
|
||||
var test_bot = {
|
||||
email: 'bot1@zulip.com',
|
||||
|
||||
Reference in New Issue
Block a user