mirror of https://github.com/zulip/zulip.git
node_tests: Restore 100% coverage on people.js.
This commit is contained in:
parent
74081ff2d5
commit
b1301cdfec
|
@ -3,7 +3,9 @@ add_dependencies({
|
||||||
});
|
});
|
||||||
|
|
||||||
var people = require("js/people.js");
|
var people = require("js/people.js");
|
||||||
set_global('blueslip', {});
|
set_global('blueslip', {
|
||||||
|
error: function () { return undefined; },
|
||||||
|
});
|
||||||
set_global('page_params', {});
|
set_global('page_params', {});
|
||||||
|
|
||||||
var _ = global._;
|
var _ = global._;
|
||||||
|
@ -82,6 +84,9 @@ initialize();
|
||||||
people.add(bot_botson);
|
people.add(bot_botson);
|
||||||
assert.equal(people.realm_user_is_active_human_or_bot(bot_botson.user_id), true);
|
assert.equal(people.realm_user_is_active_human_or_bot(bot_botson.user_id), true);
|
||||||
|
|
||||||
|
// Invalid user ID just returns false
|
||||||
|
assert.equal(people.realm_user_is_active_human_or_bot(123412), false);
|
||||||
|
|
||||||
// We can still get their info for non-realm needs.
|
// We can still get their info for non-realm needs.
|
||||||
person = people.get_by_email(email);
|
person = people.get_by_email(email);
|
||||||
assert.equal(person.email, email);
|
assert.equal(person.email, email);
|
||||||
|
|
Loading…
Reference in New Issue