node tests: Store fake users as independent variables.

This makes the fake users' objects reachable along the whole test file,
allowing to make assertions that involve user data more easily.
This commit is contained in:
Yago González 2017-06-22 23:40:27 +02:00 committed by Steve Howell
parent add869edcb
commit f908c2e442
1 changed files with 10 additions and 7 deletions

View File

@ -16,22 +16,25 @@ add_dependencies({
people: 'js/people.js',
});
global.people.add_in_realm({
var othello = {
email: 'othello@zulip.com',
user_id: 101,
full_name: "Othello, Moor of Venice",
});
global.people.add_in_realm({
};
var cordelia = {
email: 'cordelia@zulip.com',
user_id: 102,
full_name: "Cordelia Lear",
});
global.people.add({
};
var deactivated_user = {
email: 'other@zulip.com',
user_id: 103,
full_name: "Deactivated User",
});
};
global.people.add_in_realm(othello);
global.people.add_in_realm(cordelia);
global.people.add(deactivated_user);
(function test_add_topic() {
ct.add_topic('Denmark', 'civil fears');