mirror of
https://github.com/zulip/zulip.git
synced 2026-07-09 21:21:47 +08:00
There are also one or two places we don't need to use it for security purposes, but we do so for consistencey. (imported from commit aa111f5a22a0e8597ec3cf8504adae66d5fb6768)
36 lines
886 B
JavaScript
36 lines
886 B
JavaScript
var assert = require('assert');
|
|
|
|
(function set_up_dependencies () {
|
|
global._ = require('third/underscore/underscore.js');
|
|
global.activity = require('js/activity.js');
|
|
global.util = require('js/util.js');
|
|
global.Dict = require('js/dict.js');
|
|
}());
|
|
|
|
var activity = global.activity;
|
|
|
|
(function test_sort_users() {
|
|
var users = ['[email protected]', '[email protected]', '[email protected]'];
|
|
|
|
var user_info = {
|
|
'[email protected]': 'inactive',
|
|
'[email protected]': 'active',
|
|
'[email protected]': 'active'
|
|
};
|
|
|
|
|
|
global.people_dict = new global.Dict({
|
|
'[email protected]': 'Alice Smith',
|
|
'[email protected]': 'Fred Flintstone',
|
|
'[email protected]': 'Jill Hill'
|
|
});
|
|
|
|
activity._sort_users(users, user_info);
|
|
|
|
assert.deepEqual(users, [
|
|
'[email protected]',
|
|
'[email protected]',
|
|
'[email protected]'
|
|
]);
|
|
}());
|