Test startup logic in bot_data.js

(imported from commit 6410c584c2e1d8027a276902c67f34ee6a284e6f)
This commit is contained in:
Steve Howell
2014-03-12 14:31:58 -04:00
committed by Leo Franchi
parent 0d0c427f2b
commit 44bb9d58d1

View File

@@ -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',