mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 09:27:43 +00:00
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:
committed by
Steve Howell
parent
add869edcb
commit
f908c2e442
@@ -16,22 +16,25 @@ add_dependencies({
|
|||||||
people: 'js/people.js',
|
people: 'js/people.js',
|
||||||
});
|
});
|
||||||
|
|
||||||
global.people.add_in_realm({
|
var othello = {
|
||||||
email: 'othello@zulip.com',
|
email: 'othello@zulip.com',
|
||||||
user_id: 101,
|
user_id: 101,
|
||||||
full_name: "Othello, Moor of Venice",
|
full_name: "Othello, Moor of Venice",
|
||||||
});
|
};
|
||||||
global.people.add_in_realm({
|
var cordelia = {
|
||||||
email: 'cordelia@zulip.com',
|
email: 'cordelia@zulip.com',
|
||||||
user_id: 102,
|
user_id: 102,
|
||||||
full_name: "Cordelia Lear",
|
full_name: "Cordelia Lear",
|
||||||
});
|
};
|
||||||
|
var deactivated_user = {
|
||||||
global.people.add({
|
|
||||||
email: 'other@zulip.com',
|
email: 'other@zulip.com',
|
||||||
user_id: 103,
|
user_id: 103,
|
||||||
full_name: "Deactivated User",
|
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() {
|
(function test_add_topic() {
|
||||||
ct.add_topic('Denmark', 'civil fears');
|
ct.add_topic('Denmark', 'civil fears');
|
||||||
|
|||||||
Reference in New Issue
Block a user