From b1301cdfec3f25143f668ada6b92c956ff2366df Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 24 Oct 2017 16:24:03 -0700 Subject: [PATCH] node_tests: Restore 100% coverage on people.js. --- frontend_tests/node_tests/people.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend_tests/node_tests/people.js b/frontend_tests/node_tests/people.js index 103d9cec76..e6a4eb676c 100644 --- a/frontend_tests/node_tests/people.js +++ b/frontend_tests/node_tests/people.js @@ -3,7 +3,9 @@ add_dependencies({ }); var people = require("js/people.js"); -set_global('blueslip', {}); +set_global('blueslip', { + error: function () { return undefined; }, +}); set_global('page_params', {}); var _ = global._; @@ -82,6 +84,9 @@ initialize(); people.add(bot_botson); 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. person = people.get_by_email(email); assert.equal(person.email, email);