mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
eslint: Update node tests to use new comma-dangle rules.
* In most cases, eslint --fix with the right comma-dangle settings was able to update the code correctly. * The exceptions were cases where the parser incorrectly treated the arguments to functions like `assert_equal` as arguments; we fixed these manually. Since this is test code, we can be reasonably confident that just fixing the failures suffices to correct any bugs introduced by making changes automatically.
This commit is contained in:
@@ -1,48 +1,48 @@
|
||||
global.stub_out_jquery();
|
||||
|
||||
set_global('page_params', {
|
||||
people_list: []
|
||||
people_list: [],
|
||||
});
|
||||
|
||||
add_dependencies({
|
||||
util: 'js/util.js',
|
||||
people: 'js/people.js'
|
||||
people: 'js/people.js',
|
||||
});
|
||||
|
||||
set_global('resize', {
|
||||
resize_page_components: function () {}
|
||||
resize_page_components: function () {},
|
||||
});
|
||||
|
||||
set_global('document', {
|
||||
hasFocus: function () {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
var alice = {
|
||||
email: 'alice@zulip.com',
|
||||
user_id: 1,
|
||||
full_name: 'Alice Smith'
|
||||
full_name: 'Alice Smith',
|
||||
};
|
||||
var fred = {
|
||||
email: 'fred@zulip.com',
|
||||
user_id: 2,
|
||||
full_name: "Fred Flintstone"
|
||||
full_name: "Fred Flintstone",
|
||||
};
|
||||
var jill = {
|
||||
email: 'jill@zulip.com',
|
||||
user_id: 3,
|
||||
full_name: 'Jill Hill'
|
||||
full_name: 'Jill Hill',
|
||||
};
|
||||
var mark = {
|
||||
email: 'mark@zulip.com',
|
||||
user_id: 4,
|
||||
full_name: 'Marky Mark'
|
||||
full_name: 'Marky Mark',
|
||||
};
|
||||
var norbert = {
|
||||
email: 'norbert@zulip.com',
|
||||
user_id: 5,
|
||||
full_name: 'Norbert Oswald'
|
||||
full_name: 'Norbert Oswald',
|
||||
};
|
||||
|
||||
global.people.add(alice);
|
||||
@@ -71,7 +71,7 @@ activity.update_huddles = function () {};
|
||||
assert.deepEqual(user_ids, [
|
||||
fred.user_id,
|
||||
jill.user_id,
|
||||
alice.user_id
|
||||
alice.user_id,
|
||||
]);
|
||||
}());
|
||||
|
||||
@@ -89,25 +89,25 @@ activity.update_huddles = function () {};
|
||||
{
|
||||
type: 'private',
|
||||
reply_to: huddle1,
|
||||
timestamp: timestamp1
|
||||
timestamp: timestamp1,
|
||||
},
|
||||
{
|
||||
type: 'stream'
|
||||
type: 'stream',
|
||||
},
|
||||
{
|
||||
type: 'private',
|
||||
reply_to: 'ignore@zulip.com'
|
||||
reply_to: 'ignore@zulip.com',
|
||||
},
|
||||
{
|
||||
type: 'private',
|
||||
reply_to: huddle2,
|
||||
timestamp: timestamp2
|
||||
timestamp: timestamp2,
|
||||
},
|
||||
{
|
||||
type: 'private',
|
||||
reply_to: huddle2,
|
||||
timestamp: old_timestamp
|
||||
}
|
||||
timestamp: old_timestamp,
|
||||
},
|
||||
];
|
||||
|
||||
activity.process_loaded_messages(messages);
|
||||
@@ -125,13 +125,11 @@ activity.update_huddles = function () {};
|
||||
|
||||
assert.equal(
|
||||
full_name('alice@zulip.com,jill@zulip.com'),
|
||||
'Alice Smith, Jill Hill'
|
||||
);
|
||||
'Alice Smith, Jill Hill');
|
||||
|
||||
assert.equal(
|
||||
full_name('alice@zulip.com,fred@zulip.com,jill@zulip.com'),
|
||||
'Alice Smith, Fred Flintstone, Jill Hill'
|
||||
);
|
||||
'Alice Smith, Fred Flintstone, Jill Hill');
|
||||
}());
|
||||
|
||||
(function test_short_huddle_name() {
|
||||
@@ -142,28 +140,23 @@ activity.update_huddles = function () {};
|
||||
|
||||
assert.equal(
|
||||
short_name('alice@zulip.com'),
|
||||
'Alice Smith'
|
||||
);
|
||||
'Alice Smith');
|
||||
|
||||
assert.equal(
|
||||
short_name('alice@zulip.com,jill@zulip.com'),
|
||||
'Alice Smith, Jill Hill'
|
||||
);
|
||||
'Alice Smith, Jill Hill');
|
||||
|
||||
assert.equal(
|
||||
short_name('alice@zulip.com,fred@zulip.com,jill@zulip.com'),
|
||||
'Alice Smith, Fred Flintstone, Jill Hill'
|
||||
);
|
||||
'Alice Smith, Fred Flintstone, Jill Hill');
|
||||
|
||||
assert.equal(
|
||||
short_name('alice@zulip.com,fred@zulip.com,jill@zulip.com,mark@zulip.com'),
|
||||
'Alice Smith, Fred Flintstone, Jill Hill, + 1 other'
|
||||
);
|
||||
'Alice Smith, Fred Flintstone, Jill Hill, + 1 other');
|
||||
|
||||
assert.equal(
|
||||
short_name('alice@zulip.com,fred@zulip.com,jill@zulip.com,mark@zulip.com,norbert@zulip.com'),
|
||||
'Alice Smith, Fred Flintstone, Jill Hill, + 2 others'
|
||||
);
|
||||
'Alice Smith, Fred Flintstone, Jill Hill, + 2 others');
|
||||
|
||||
}());
|
||||
|
||||
@@ -179,8 +172,7 @@ activity.update_huddles = function () {};
|
||||
|
||||
assert.equal(
|
||||
activity.huddle_fraction_present(huddle, presence_list),
|
||||
'0.50'
|
||||
);
|
||||
'0.50');
|
||||
}());
|
||||
|
||||
|
||||
@@ -189,57 +181,50 @@ activity.update_huddles = function () {};
|
||||
var presence = {
|
||||
website: {
|
||||
status: "active",
|
||||
timestamp: base_time
|
||||
}
|
||||
timestamp: base_time,
|
||||
},
|
||||
};
|
||||
var status = activity._status_from_timestamp(
|
||||
base_time + activity._OFFLINE_THRESHOLD_SECS - 1, presence
|
||||
);
|
||||
base_time + activity._OFFLINE_THRESHOLD_SECS - 1, presence);
|
||||
assert.equal(status.mobile, false);
|
||||
|
||||
presence.Android = {
|
||||
status: "active",
|
||||
timestamp: base_time + activity._OFFLINE_THRESHOLD_SECS / 2,
|
||||
pushable: false
|
||||
pushable: false,
|
||||
};
|
||||
status = activity._status_from_timestamp(
|
||||
base_time + activity._OFFLINE_THRESHOLD_SECS, presence
|
||||
);
|
||||
base_time + activity._OFFLINE_THRESHOLD_SECS, presence);
|
||||
assert.equal(status.mobile, true);
|
||||
assert.equal(status.status, "active");
|
||||
|
||||
status = activity._status_from_timestamp(
|
||||
base_time + activity._OFFLINE_THRESHOLD_SECS - 1, presence
|
||||
);
|
||||
base_time + activity._OFFLINE_THRESHOLD_SECS - 1, presence);
|
||||
assert.equal(status.mobile, false);
|
||||
assert.equal(status.status, "active");
|
||||
|
||||
status = activity._status_from_timestamp(
|
||||
base_time + activity._OFFLINE_THRESHOLD_SECS * 2, presence
|
||||
);
|
||||
base_time + activity._OFFLINE_THRESHOLD_SECS * 2, presence);
|
||||
assert.equal(status.mobile, false);
|
||||
assert.equal(status.status, "offline");
|
||||
|
||||
presence.Android = {
|
||||
status: "idle",
|
||||
timestamp: base_time + activity._OFFLINE_THRESHOLD_SECS / 2,
|
||||
pushable: true
|
||||
pushable: true,
|
||||
};
|
||||
status = activity._status_from_timestamp(
|
||||
base_time + activity._OFFLINE_THRESHOLD_SECS, presence
|
||||
);
|
||||
base_time + activity._OFFLINE_THRESHOLD_SECS, presence);
|
||||
assert.equal(status.mobile, true);
|
||||
assert.equal(status.status, "idle");
|
||||
|
||||
status = activity._status_from_timestamp(
|
||||
base_time + activity._OFFLINE_THRESHOLD_SECS - 1, presence
|
||||
);
|
||||
base_time + activity._OFFLINE_THRESHOLD_SECS - 1, presence);
|
||||
assert.equal(status.mobile, false);
|
||||
assert.equal(status.status, "active");
|
||||
|
||||
status = activity._status_from_timestamp(
|
||||
base_time + activity._OFFLINE_THRESHOLD_SECS * 2, presence
|
||||
);
|
||||
base_time + activity._OFFLINE_THRESHOLD_SECS * 2, presence);
|
||||
assert.equal(status.mobile, true);
|
||||
assert.equal(status.status, "offline");
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
add_dependencies({
|
||||
util: 'js/util.js'
|
||||
util: 'js/util.js',
|
||||
});
|
||||
|
||||
set_global('page_params', {
|
||||
alert_words: ['alertone', 'alerttwo', 'alertthree', 'al*rt.*s', '.+'],
|
||||
email: 'tester@zulip.com'
|
||||
email: 'tester@zulip.com',
|
||||
});
|
||||
|
||||
set_global('feature_flags', {
|
||||
alert_words: true
|
||||
alert_words: true,
|
||||
});
|
||||
|
||||
var alert_words = require('js/alert_words.js');
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
add_dependencies({
|
||||
util: 'js/util.js'
|
||||
util: 'js/util.js',
|
||||
});
|
||||
|
||||
var _ = global._;
|
||||
@@ -15,7 +15,7 @@ set_global('document', null);
|
||||
var page_params = {
|
||||
bot_list: [{email: 'bot0@zulip.com', full_name: 'Bot 0'}],
|
||||
is_admin: false,
|
||||
email: 'owner@zulip.com'
|
||||
email: 'owner@zulip.com',
|
||||
};
|
||||
set_global('page_params', page_params);
|
||||
|
||||
@@ -37,7 +37,7 @@ assert.equal(bot_data.get('bot0@zulip.com').full_name, 'Bot 0');
|
||||
default_events_register_stream: '',
|
||||
default_sending_stream: '',
|
||||
full_name: 'Bot 1',
|
||||
extra: 'Not in data'
|
||||
extra: 'Not in data',
|
||||
};
|
||||
|
||||
(function test_add() {
|
||||
|
||||
@@ -11,24 +11,24 @@ set_global('stream_data', {subscribed_streams: function () {
|
||||
|
||||
global.stub_out_jquery();
|
||||
add_dependencies({
|
||||
people: 'js/people.js'
|
||||
people: 'js/people.js',
|
||||
});
|
||||
|
||||
global.people.add_in_realm({
|
||||
email: 'othello@zulip.com',
|
||||
user_id: 101,
|
||||
full_name: "Othello, Moor of Venice"
|
||||
full_name: "Othello, Moor of Venice",
|
||||
});
|
||||
global.people.add_in_realm({
|
||||
email: 'cordelia@zulip.com',
|
||||
user_id: 102,
|
||||
full_name: "Cordelia Lear"
|
||||
full_name: "Cordelia Lear",
|
||||
});
|
||||
|
||||
global.people.add({
|
||||
email: 'other@zulip.com',
|
||||
user_id: 103,
|
||||
full_name: "Deactivated User"
|
||||
full_name: "Deactivated User",
|
||||
});
|
||||
|
||||
(function test_add_topic () {
|
||||
|
||||
@@ -7,11 +7,11 @@ var noop = function () {};
|
||||
// dispatcher from server_events.
|
||||
(function work_around_server_events_loading_issues() {
|
||||
add_dependencies({
|
||||
util: 'js/util.js'
|
||||
util: 'js/util.js',
|
||||
});
|
||||
set_global('document', {});
|
||||
set_global('window', {
|
||||
addEventListener: noop
|
||||
addEventListener: noop,
|
||||
});
|
||||
global.stub_out_jquery();
|
||||
}());
|
||||
@@ -21,17 +21,17 @@ var noop = function () {};
|
||||
set_global('tutorial', {
|
||||
is_running: function () {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
});
|
||||
set_global('home_msg_list', {
|
||||
select_id: noop,
|
||||
selected_id: function () {return 1;}
|
||||
selected_id: function () {return 1;},
|
||||
});
|
||||
set_global('echo', {
|
||||
process_from_server: function (messages) {
|
||||
return messages;
|
||||
},
|
||||
set_realm_filters: noop
|
||||
set_realm_filters: noop,
|
||||
});
|
||||
|
||||
// page_params is highly coupled to dispatching now
|
||||
@@ -79,7 +79,7 @@ function dispatch(ev) {
|
||||
var event_fixtures = {
|
||||
alert_words: {
|
||||
type: 'alert_words',
|
||||
alert_words: ['fire', 'lunch']
|
||||
alert_words: ['fire', 'lunch'],
|
||||
},
|
||||
|
||||
default_streams: {
|
||||
@@ -89,33 +89,33 @@ var event_fixtures = {
|
||||
name: 'devel',
|
||||
description: 'devel',
|
||||
invite_only: false,
|
||||
stream_id: 1
|
||||
stream_id: 1,
|
||||
},
|
||||
{
|
||||
name: 'test',
|
||||
description: 'test',
|
||||
invite_only: true,
|
||||
stream_id: 1
|
||||
}
|
||||
]
|
||||
stream_id: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
message: {
|
||||
type: 'message',
|
||||
message: {
|
||||
content: 'hello'
|
||||
content: 'hello',
|
||||
},
|
||||
flags: []
|
||||
flags: [],
|
||||
},
|
||||
|
||||
muted_topics: {
|
||||
type: 'muted_topics',
|
||||
muted_topics: [['devel', 'js'], ['lunch', 'burritos']]
|
||||
muted_topics: [['devel', 'js'], ['lunch', 'burritos']],
|
||||
},
|
||||
|
||||
pointer: {
|
||||
type: 'pointer',
|
||||
pointer: 999
|
||||
pointer: 999,
|
||||
},
|
||||
|
||||
presence: {
|
||||
@@ -123,10 +123,10 @@ var event_fixtures = {
|
||||
email: 'alice@example.com',
|
||||
presence: {
|
||||
client_name: 'electron',
|
||||
is_mirror_dummy: false
|
||||
is_mirror_dummy: false,
|
||||
// etc.
|
||||
},
|
||||
server_timestamp: 999999
|
||||
server_timestamp: 999999,
|
||||
},
|
||||
|
||||
// Please keep this next section un-nested, as we want this to partly
|
||||
@@ -135,35 +135,35 @@ var event_fixtures = {
|
||||
type: 'realm',
|
||||
op: 'update',
|
||||
property: 'create_stream_by_admins_only',
|
||||
value: false
|
||||
value: false,
|
||||
},
|
||||
|
||||
realm__update__invite_by_admins_only: {
|
||||
type: 'realm',
|
||||
op: 'update',
|
||||
property: 'invite_by_admins_only',
|
||||
value: false
|
||||
value: false,
|
||||
},
|
||||
|
||||
realm__update__invite_required: {
|
||||
type: 'realm',
|
||||
op: 'update',
|
||||
property: 'invite_required',
|
||||
value: false
|
||||
value: false,
|
||||
},
|
||||
|
||||
realm__update__name: {
|
||||
type: 'realm',
|
||||
op: 'update',
|
||||
property: 'name',
|
||||
value: 'new_realm_name'
|
||||
value: 'new_realm_name',
|
||||
},
|
||||
|
||||
realm__update__restricted_to_domain: {
|
||||
type: 'realm',
|
||||
op: 'update',
|
||||
property: 'restricted_to_domain',
|
||||
value: false
|
||||
value: false,
|
||||
},
|
||||
|
||||
realm__update_dict__default: {
|
||||
@@ -172,8 +172,8 @@ var event_fixtures = {
|
||||
property: 'default',
|
||||
data: {
|
||||
allow_message_editing: true,
|
||||
message_content_edit_limit_seconds: 5
|
||||
}
|
||||
message_content_edit_limit_seconds: 5,
|
||||
},
|
||||
},
|
||||
|
||||
realm_bot__add: {
|
||||
@@ -181,9 +181,9 @@ var event_fixtures = {
|
||||
op: 'add',
|
||||
bot: {
|
||||
email: 'the-bot@example.com',
|
||||
full_name: 'The Bot'
|
||||
full_name: 'The Bot',
|
||||
// etc.
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
realm_bot__remove: {
|
||||
@@ -191,8 +191,8 @@ var event_fixtures = {
|
||||
op: 'remove',
|
||||
bot: {
|
||||
email: 'the-bot@example.com',
|
||||
full_name: 'The Bot'
|
||||
}
|
||||
full_name: 'The Bot',
|
||||
},
|
||||
},
|
||||
|
||||
realm_bot__update: {
|
||||
@@ -200,24 +200,24 @@ var event_fixtures = {
|
||||
op: 'update',
|
||||
bot: {
|
||||
email: 'the-bot@example.com',
|
||||
full_name: 'The Bot Has A New Name'
|
||||
}
|
||||
full_name: 'The Bot Has A New Name',
|
||||
},
|
||||
},
|
||||
|
||||
realm_emoji: {
|
||||
type: 'realm_emoji',
|
||||
realm_emoji: {
|
||||
airplane: {
|
||||
display_url: 'some_url'
|
||||
}
|
||||
}
|
||||
display_url: 'some_url',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
realm_filters: {
|
||||
type: 'realm_filters',
|
||||
realm_filters: [
|
||||
['#[123]', 'ticket %(id)s']
|
||||
]
|
||||
['#[123]', 'ticket %(id)s'],
|
||||
],
|
||||
},
|
||||
|
||||
realm_user__add: {
|
||||
@@ -225,9 +225,9 @@ var event_fixtures = {
|
||||
op: 'add',
|
||||
person: {
|
||||
email: 'alice@example.com',
|
||||
full_name: 'Alice User'
|
||||
full_name: 'Alice User',
|
||||
// etc.
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
realm_user__remove: {
|
||||
@@ -235,9 +235,9 @@ var event_fixtures = {
|
||||
op: 'remove',
|
||||
person: {
|
||||
email: 'alice@example.com',
|
||||
full_name: 'Alice User'
|
||||
full_name: 'Alice User',
|
||||
// etc.
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
realm_user__update: {
|
||||
@@ -245,22 +245,22 @@ var event_fixtures = {
|
||||
op: 'update',
|
||||
person: {
|
||||
email: 'alice@example.com',
|
||||
full_name: 'Alice NewName'
|
||||
full_name: 'Alice NewName',
|
||||
// etc.
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
referral: {
|
||||
type: 'referral',
|
||||
referrals: {
|
||||
granted: 10,
|
||||
used: 5
|
||||
}
|
||||
used: 5,
|
||||
},
|
||||
},
|
||||
|
||||
restart: {
|
||||
type: 'restart',
|
||||
immediate: true
|
||||
immediate: true,
|
||||
},
|
||||
|
||||
stream: {
|
||||
@@ -268,7 +268,7 @@ var event_fixtures = {
|
||||
op: 'update',
|
||||
name: 'devel',
|
||||
property: 'color',
|
||||
value: 'blue'
|
||||
value: 'blue',
|
||||
},
|
||||
|
||||
subscription__add: {
|
||||
@@ -277,10 +277,10 @@ var event_fixtures = {
|
||||
subscriptions: [
|
||||
{
|
||||
name: 'devel',
|
||||
stream_id: 42
|
||||
stream_id: 42,
|
||||
// etc.
|
||||
}
|
||||
]
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
subscription__remove: {
|
||||
@@ -288,9 +288,9 @@ var event_fixtures = {
|
||||
op: 'remove',
|
||||
subscriptions: [
|
||||
{
|
||||
stream_id: 42
|
||||
}
|
||||
]
|
||||
stream_id: 42,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
subscription__peer_add: {
|
||||
@@ -300,10 +300,10 @@ var event_fixtures = {
|
||||
subscriptions: [
|
||||
{
|
||||
name: 'devel',
|
||||
stream_id: 42
|
||||
stream_id: 42,
|
||||
// etc.
|
||||
}
|
||||
]
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
subscription__peer_remove: {
|
||||
@@ -312,10 +312,10 @@ var event_fixtures = {
|
||||
user_id: 555,
|
||||
subscriptions: [
|
||||
{
|
||||
stream_id: 42
|
||||
stream_id: 42,
|
||||
// etc.
|
||||
}
|
||||
]
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
subscription__update: {
|
||||
@@ -323,46 +323,46 @@ var event_fixtures = {
|
||||
op: 'update',
|
||||
name: 'devel',
|
||||
property: 'color',
|
||||
value: 'black'
|
||||
value: 'black',
|
||||
},
|
||||
|
||||
update_display_settings__default_language: {
|
||||
type: 'update_display_settings',
|
||||
setting_name: 'default_language',
|
||||
default_language: 'fr'
|
||||
default_language: 'fr',
|
||||
},
|
||||
|
||||
update_display_settings__left_side_userlist: {
|
||||
type: 'update_display_settings',
|
||||
setting_name: 'left_side_userlist',
|
||||
left_side_userlist: true
|
||||
left_side_userlist: true,
|
||||
},
|
||||
|
||||
update_display_settings__twenty_four_hour_time: {
|
||||
type: 'update_display_settings',
|
||||
setting_name: 'twenty_four_hour_time',
|
||||
twenty_four_hour_time: true
|
||||
twenty_four_hour_time: true,
|
||||
},
|
||||
|
||||
update_global_notifications: {
|
||||
type: 'update_global_notifications',
|
||||
notification_name: 'enable_stream_sounds',
|
||||
setting: true
|
||||
setting: true,
|
||||
},
|
||||
|
||||
update_message_flags__read: {
|
||||
type: 'update_message_flags',
|
||||
operation: 'add',
|
||||
flag: 'read',
|
||||
messages: [5, 999]
|
||||
messages: [5, 999],
|
||||
},
|
||||
|
||||
update_message_flags__starred: {
|
||||
type: 'update_message_flags',
|
||||
operation: 'add',
|
||||
flag: 'starred',
|
||||
messages: [7, 99]
|
||||
}
|
||||
messages: [7, 99],
|
||||
},
|
||||
};
|
||||
|
||||
function assert_same(actual, expected) {
|
||||
@@ -623,8 +623,7 @@ run(function (override, capture, args) {
|
||||
override(
|
||||
'subs',
|
||||
'update_subscription_properties',
|
||||
capture(['name', 'property', 'value'])
|
||||
);
|
||||
capture(['name', 'property', 'value']));
|
||||
override('admin', 'update_default_streams_table', noop);
|
||||
dispatch(event);
|
||||
assert_same(args.name, event.name);
|
||||
@@ -677,8 +676,7 @@ run(function (override, capture, args) {
|
||||
override(
|
||||
'subs',
|
||||
'update_subscription_properties',
|
||||
capture(['name', 'property', 'value'])
|
||||
);
|
||||
capture(['name', 'property', 'value']));
|
||||
dispatch(event);
|
||||
assert_same(args.name, event.name);
|
||||
assert_same(args.property, event.property);
|
||||
@@ -711,8 +709,7 @@ run(function (override, capture, args) {
|
||||
override(
|
||||
'notifications',
|
||||
'handle_global_notification_updates',
|
||||
capture(['name', 'setting'])
|
||||
);
|
||||
capture(['name', 'setting']));
|
||||
dispatch(event);
|
||||
assert_same(args.name, event.notification_name);
|
||||
assert_same(args.setting, event.setting);
|
||||
|
||||
@@ -10,22 +10,22 @@ set_global('page_params', {
|
||||
people_list: [],
|
||||
realm_emoji: {
|
||||
burrito: {display_url: '/static/third/gemoji/images/emoji/burrito.png',
|
||||
source_url: '/static/third/gemoji/images/emoji/burrito.png'}
|
||||
source_url: '/static/third/gemoji/images/emoji/burrito.png'},
|
||||
},
|
||||
realm_filters: [
|
||||
[
|
||||
"#(?P<id>[0-9]{2,8})",
|
||||
"https://trac.zulip.net/ticket/%(id)s"
|
||||
"https://trac.zulip.net/ticket/%(id)s",
|
||||
],
|
||||
[
|
||||
"ZBUG_(?P<id>[0-9]{2,8})",
|
||||
"https://trac2.zulip.net/ticket/%(id)s"
|
||||
"https://trac2.zulip.net/ticket/%(id)s",
|
||||
],
|
||||
[
|
||||
"ZGROUP_(?P<id>[0-9]{2,8}):(?P<zone>[0-9]{1,8})",
|
||||
"https://zone_%(zone)s.zulip.net/ticket/%(id)s"
|
||||
]
|
||||
]
|
||||
"https://zone_%(zone)s.zulip.net/ticket/%(id)s",
|
||||
],
|
||||
],
|
||||
});
|
||||
|
||||
add_dependencies({
|
||||
@@ -34,7 +34,7 @@ add_dependencies({
|
||||
people: 'js/people.js',
|
||||
stream_data: 'js/stream_data.js',
|
||||
hashchange: 'js/hashchange',
|
||||
fenced_code: 'js/fenced_code.js'
|
||||
fenced_code: 'js/fenced_code.js',
|
||||
});
|
||||
|
||||
var doc = "";
|
||||
@@ -61,7 +61,7 @@ var people = global.people;
|
||||
people.add({
|
||||
full_name: 'Cordelia Lear',
|
||||
user_id: 101,
|
||||
email: 'cordelia@zulip.com'
|
||||
email: 'cordelia@zulip.com',
|
||||
});
|
||||
|
||||
var stream_data = global.stream_data;
|
||||
@@ -70,7 +70,7 @@ var denmark = {
|
||||
color: 'blue',
|
||||
name: 'Denmark',
|
||||
stream_id: 1,
|
||||
in_home_view: false
|
||||
in_home_view: false,
|
||||
};
|
||||
var social = {
|
||||
subscribed: true,
|
||||
@@ -78,7 +78,7 @@ var social = {
|
||||
name: 'social',
|
||||
stream_id: 2,
|
||||
in_home_view: true,
|
||||
invite_only: true
|
||||
invite_only: true,
|
||||
};
|
||||
stream_data.add_sub('Denmark', denmark);
|
||||
stream_data.add_sub('social', social);
|
||||
@@ -107,7 +107,7 @@ var bugdown_data = JSON.parse(fs.readFileSync(path.join(__dirname, '../../zerver
|
||||
"User Mention @**leo with some name**",
|
||||
"Stream #**Verona**",
|
||||
"This contains !gravatar(leo@zulip.com)",
|
||||
"And an avatar !avatar(leo@zulip.com) is here"
|
||||
"And an avatar !avatar(leo@zulip.com) is here",
|
||||
];
|
||||
|
||||
var markup = [
|
||||
@@ -122,7 +122,7 @@ var bugdown_data = JSON.parse(fs.readFileSync(path.join(__dirname, '../../zerver
|
||||
"https://twitter.com/jacobian/status/407886996565016579",
|
||||
"then https://twitter.com/jacobian/status/407886996565016579",
|
||||
"twitter url http://twitter.com/jacobian/status/407886996565016579",
|
||||
"youtube url https://www.youtube.com/watch?v=HHZ8iqswiCw&feature=youtu.be&a"
|
||||
"youtube url https://www.youtube.com/watch?v=HHZ8iqswiCw&feature=youtu.be&a",
|
||||
];
|
||||
|
||||
no_markup.forEach(function (content) {
|
||||
@@ -186,7 +186,7 @@ var bugdown_data = JSON.parse(fs.readFileSync(path.join(__dirname, '../../zerver
|
||||
{input: 'This is a !gravatar(cordelia@zulip.com) of Cordelia Lear',
|
||||
expected: '<p>This is a <img alt="cordelia@zulip.com" class="message_body_gravatar" src="/avatar/cordelia@zulip.com?s=30" title="cordelia@zulip.com"> of Cordelia Lear</p>'},
|
||||
{input: 'Test *italic*',
|
||||
expected: '<p>Test <em>italic</em></p>'}
|
||||
expected: '<p>Test <em>italic</em></p>'},
|
||||
];
|
||||
|
||||
test_cases.forEach(function (test_case) {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
add_dependencies({
|
||||
util: 'js/util.js',
|
||||
stream_data: 'js/stream_data.js'
|
||||
stream_data: 'js/stream_data.js',
|
||||
});
|
||||
|
||||
set_global('page_params', {
|
||||
email: 'hamlet@zulip.com',
|
||||
domain: 'zulip.com'
|
||||
domain: 'zulip.com',
|
||||
});
|
||||
|
||||
set_global('feature_flags', {});
|
||||
@@ -24,7 +24,7 @@ function assert_same_operators(result, terms) {
|
||||
return {
|
||||
negated: negated,
|
||||
operator: term.operator,
|
||||
operand: term.operand
|
||||
operand: term.operand,
|
||||
};
|
||||
});
|
||||
assert.deepEqual(result, terms);
|
||||
@@ -34,7 +34,7 @@ function assert_same_operators(result, terms) {
|
||||
var operators = [
|
||||
{operator: 'stream', operand: 'foo'},
|
||||
{operator: 'stream', operand: 'exclude_stream', negated: true},
|
||||
{operator: 'topic', operand: 'bar'}
|
||||
{operator: 'topic', operand: 'bar'},
|
||||
];
|
||||
var filter = new Filter(operators);
|
||||
|
||||
@@ -54,7 +54,7 @@ function assert_same_operators(result, terms) {
|
||||
operators = [
|
||||
{operator: 'stream', operand: 'foo'},
|
||||
{operator: 'topic', operand: 'bar'},
|
||||
{operator: 'search', operand: 'pizza'}
|
||||
{operator: 'search', operand: 'pizza'},
|
||||
];
|
||||
filter = new Filter(operators);
|
||||
|
||||
@@ -65,7 +65,7 @@ function assert_same_operators(result, terms) {
|
||||
// we don't consider ourselves to have a stream operator, because we don't
|
||||
// want to have the stream in the tab bar or unsubscribe messaging, etc.
|
||||
operators = [
|
||||
{operator: 'stream', operand: 'exclude', negated: true}
|
||||
{operator: 'stream', operand: 'exclude', negated: true},
|
||||
];
|
||||
filter = new Filter(operators);
|
||||
assert(!filter.has_operator('stream'));
|
||||
@@ -74,7 +74,7 @@ function assert_same_operators(result, terms) {
|
||||
// the search logic happens on the back end and we need to have can_apply_locally()
|
||||
// be false, and we want "Search results" in the tab bar.
|
||||
operators = [
|
||||
{operator: 'search', operand: 'stop_word', negated: true}
|
||||
{operator: 'search', operand: 'stop_word', negated: true},
|
||||
];
|
||||
filter = new Filter(operators);
|
||||
assert(filter.has_operator('search'));
|
||||
@@ -82,7 +82,7 @@ function assert_same_operators(result, terms) {
|
||||
|
||||
// Similar logic applies to negated "has" searches.
|
||||
operators = [
|
||||
{operator: 'has', operand: 'images', negated: true}
|
||||
{operator: 'has', operand: 'images', negated: true},
|
||||
];
|
||||
filter = new Filter(operators);
|
||||
assert(filter.has_operator('has'));
|
||||
@@ -92,7 +92,7 @@ function assert_same_operators(result, terms) {
|
||||
(function test_topic_stuff() {
|
||||
var operators = [
|
||||
{operator: 'stream', operand: 'foo'},
|
||||
{operator: 'topic', operand: 'old topic'}
|
||||
{operator: 'topic', operand: 'old topic'},
|
||||
];
|
||||
var filter = new Filter(operators);
|
||||
|
||||
@@ -109,7 +109,7 @@ function assert_same_operators(result, terms) {
|
||||
(function test_new_style_operators() {
|
||||
var term = {
|
||||
operator: 'stream',
|
||||
operand: 'foo'
|
||||
operand: 'foo',
|
||||
};
|
||||
var operators = [term];
|
||||
var filter = new Filter(operators);
|
||||
@@ -121,7 +121,7 @@ function assert_same_operators(result, terms) {
|
||||
var operators = [
|
||||
{operator: 'stream', operand: 'foo'},
|
||||
{operator: 'in', operand: 'all'},
|
||||
{operator: 'topic', operand: 'bar'}
|
||||
{operator: 'topic', operand: 'bar'},
|
||||
];
|
||||
|
||||
var filter = new Filter(operators);
|
||||
@@ -129,7 +129,7 @@ function assert_same_operators(result, terms) {
|
||||
|
||||
global.page_params.narrow_stream = 'default';
|
||||
operators = [
|
||||
{operator: 'stream', operand: 'default'}
|
||||
{operator: 'stream', operand: 'default'},
|
||||
];
|
||||
filter = new Filter(operators);
|
||||
assert_same_operators(filter.public_operators(), []);
|
||||
@@ -261,7 +261,7 @@ function get_predicate(operators) {
|
||||
var narrow;
|
||||
|
||||
narrow = [
|
||||
{operator: 'stream', operand: 'social', negated: true}
|
||||
{operator: 'stream', operand: 'social', negated: true},
|
||||
];
|
||||
predicate = new Filter(narrow).predicate();
|
||||
assert(predicate({type: 'stream', stream: 'devel'}));
|
||||
@@ -285,7 +285,7 @@ function get_predicate(operators) {
|
||||
// Try to get the MIT regex to explode for an empty stream.
|
||||
var terms = [
|
||||
{operator: 'stream', operand: ''},
|
||||
{operator: 'topic', operand: 'bar'}
|
||||
{operator: 'topic', operand: 'bar'},
|
||||
];
|
||||
predicate = new Filter(terms).predicate();
|
||||
assert(!predicate({type: 'stream', stream: 'foo', subject: 'bar'}));
|
||||
@@ -293,7 +293,7 @@ function get_predicate(operators) {
|
||||
// Try to get the MIT regex to explode for an empty topic.
|
||||
terms = [
|
||||
{operator: 'stream', operand: 'foo'},
|
||||
{operator: 'topic', operand: ''}
|
||||
{operator: 'topic', operand: ''},
|
||||
];
|
||||
predicate = new Filter(terms).predicate();
|
||||
assert(!predicate({type: 'stream', stream: 'foo', subject: 'bar'}));
|
||||
@@ -321,7 +321,7 @@ function get_predicate(operators) {
|
||||
// Exercise caching feature.
|
||||
var terms = [
|
||||
{operator: 'stream', operand: 'Foo'},
|
||||
{operator: 'topic', operand: 'bar'}
|
||||
{operator: 'topic', operand: 'bar'},
|
||||
];
|
||||
var filter = new Filter(terms);
|
||||
predicate = filter.predicate();
|
||||
@@ -343,38 +343,38 @@ function get_predicate(operators) {
|
||||
operators = [
|
||||
{operator: 'stream', operand: 'Foo'},
|
||||
{operator: 'topic', operand: 'Bar'},
|
||||
{operator: 'search', operand: 'yo'}
|
||||
{operator: 'search', operand: 'yo'},
|
||||
];
|
||||
_test();
|
||||
|
||||
string = 'pm-with:leo+test@zulip.com';
|
||||
operators = [
|
||||
{operator: 'pm-with', operand: 'leo+test@zulip.com'}
|
||||
{operator: 'pm-with', operand: 'leo+test@zulip.com'},
|
||||
];
|
||||
_test();
|
||||
|
||||
string = 'sender:leo+test@zulip.com';
|
||||
operators = [
|
||||
{operator: 'sender', operand: 'leo+test@zulip.com'}
|
||||
{operator: 'sender', operand: 'leo+test@zulip.com'},
|
||||
];
|
||||
_test();
|
||||
|
||||
string = 'stream:With+Space';
|
||||
operators = [
|
||||
{operator: 'stream', operand: 'With Space'}
|
||||
{operator: 'stream', operand: 'With Space'},
|
||||
];
|
||||
_test();
|
||||
|
||||
string = 'https://www.google.com';
|
||||
operators = [
|
||||
{operator: 'search', operand: 'https://www.google.com'}
|
||||
{operator: 'search', operand: 'https://www.google.com'},
|
||||
];
|
||||
_test();
|
||||
|
||||
string = 'stream:foo -stream:exclude';
|
||||
operators = [
|
||||
{operator: 'stream', operand: 'foo'},
|
||||
{operator: 'stream', operand: 'exclude', negated: true}
|
||||
{operator: 'stream', operand: 'exclude', negated: true},
|
||||
];
|
||||
_test();
|
||||
}());
|
||||
@@ -386,19 +386,19 @@ function get_predicate(operators) {
|
||||
operators = [
|
||||
{operator: 'stream', operand: 'Foo'},
|
||||
{operator: 'topic', operand: 'Bar', negated: true},
|
||||
{operator: 'search', operand: 'yo'}
|
||||
{operator: 'search', operand: 'yo'},
|
||||
];
|
||||
string = 'stream:Foo -topic:Bar yo';
|
||||
assert.deepEqual(Filter.unparse(operators), string);
|
||||
|
||||
operators = [
|
||||
{operator: 'id', operand: 50}
|
||||
{operator: 'id', operand: 50},
|
||||
];
|
||||
string = 'id:50';
|
||||
assert.deepEqual(Filter.unparse(operators), string);
|
||||
|
||||
operators = [
|
||||
{operator: 'near', operand: 150}
|
||||
{operator: 'near', operand: 150},
|
||||
];
|
||||
string = 'near:150';
|
||||
assert.deepEqual(Filter.unparse(operators), string);
|
||||
@@ -410,85 +410,85 @@ function get_predicate(operators) {
|
||||
|
||||
narrow = [
|
||||
{operator: 'stream', operand: 'devel'},
|
||||
{operator: 'is', operand: 'starred'}
|
||||
{operator: 'is', operand: 'starred'},
|
||||
];
|
||||
string = 'Narrow to stream devel, Narrow to starred messages';
|
||||
assert.equal(Filter.describe(narrow), string);
|
||||
|
||||
narrow = [
|
||||
{operator: 'stream', operand: 'devel'},
|
||||
{operator: 'topic', operand: 'JS'}
|
||||
{operator: 'topic', operand: 'JS'},
|
||||
];
|
||||
string = 'Narrow to devel > JS';
|
||||
assert.equal(Filter.describe(narrow), string);
|
||||
|
||||
narrow = [
|
||||
{operator: 'is', operand: 'private'},
|
||||
{operator: 'search', operand: 'lunch'}
|
||||
{operator: 'search', operand: 'lunch'},
|
||||
];
|
||||
string = 'Narrow to all private messages, Search for lunch';
|
||||
assert.equal(Filter.describe(narrow), string);
|
||||
|
||||
narrow = [
|
||||
{operator: 'id', operand: 99}
|
||||
{operator: 'id', operand: 99},
|
||||
];
|
||||
string = 'Narrow to message ID 99';
|
||||
assert.equal(Filter.describe(narrow), string);
|
||||
|
||||
narrow = [
|
||||
{operator: 'in', operand: 'home'}
|
||||
{operator: 'in', operand: 'home'},
|
||||
];
|
||||
string = 'Narrow to messages in home';
|
||||
assert.equal(Filter.describe(narrow), string);
|
||||
|
||||
narrow = [
|
||||
{operator: 'is', operand: 'mentioned'}
|
||||
{operator: 'is', operand: 'mentioned'},
|
||||
];
|
||||
string = 'Narrow to mentioned messages';
|
||||
assert.equal(Filter.describe(narrow), string);
|
||||
|
||||
narrow = [
|
||||
{operator: 'is', operand: 'alerted'}
|
||||
{operator: 'is', operand: 'alerted'},
|
||||
];
|
||||
string = 'Narrow to alerted messages';
|
||||
assert.equal(Filter.describe(narrow), string);
|
||||
|
||||
narrow = [
|
||||
{operator: 'is', operand: 'something_we_do_not_support'}
|
||||
{operator: 'is', operand: 'something_we_do_not_support'},
|
||||
];
|
||||
string = 'Narrow to (unknown operator)';
|
||||
assert.equal(Filter.describe(narrow), string);
|
||||
|
||||
narrow = [
|
||||
{operator: 'bogus', operand: 'foo'}
|
||||
{operator: 'bogus', operand: 'foo'},
|
||||
];
|
||||
string = 'Narrow to (unknown operator)';
|
||||
assert.equal(Filter.describe(narrow), string);
|
||||
|
||||
narrow = [
|
||||
{operator: 'stream', operand: 'devel'},
|
||||
{operator: 'topic', operand: 'JS', negated: true}
|
||||
{operator: 'topic', operand: 'JS', negated: true},
|
||||
];
|
||||
string = 'Narrow to stream devel, Exclude topic JS';
|
||||
assert.equal(Filter.describe(narrow), string);
|
||||
|
||||
narrow = [
|
||||
{operator: 'is', operand: 'private'},
|
||||
{operator: 'search', operand: 'lunch', negated: true}
|
||||
{operator: 'search', operand: 'lunch', negated: true},
|
||||
];
|
||||
string = 'Narrow to all private messages, Exclude lunch';
|
||||
assert.equal(Filter.describe(narrow), string);
|
||||
|
||||
narrow = [
|
||||
{operator: 'stream', operand: 'devel'},
|
||||
{operator: 'is', operand: 'starred', negated: true}
|
||||
{operator: 'is', operand: 'starred', negated: true},
|
||||
];
|
||||
string = 'Narrow to stream devel, Exclude starred messages';
|
||||
assert.equal(Filter.describe(narrow), string);
|
||||
|
||||
narrow = [
|
||||
{operator: 'stream', operand: 'devel'},
|
||||
{operator: 'has', operand: 'image', negated: true}
|
||||
{operator: 'has', operand: 'image', negated: true},
|
||||
];
|
||||
string = 'Narrow to stream devel, Exclude messages with one or more image';
|
||||
assert.equal(Filter.describe(narrow), string);
|
||||
|
||||
@@ -6,14 +6,14 @@ var hashchange = require('js/hashchange.js');
|
||||
|
||||
operators = [
|
||||
{operator: 'stream', operand: 'devel'},
|
||||
{operator: 'topic', operand: 'algol'}
|
||||
{operator: 'topic', operand: 'algol'},
|
||||
];
|
||||
hash = hashchange.operators_to_hash(operators);
|
||||
assert.equal(hash, '#narrow/stream/devel/topic/algol');
|
||||
|
||||
operators = [
|
||||
{operator: 'stream', operand: 'devel'},
|
||||
{operator: 'topic', operand: 'visual c++', negated: true}
|
||||
{operator: 'topic', operand: 'visual c++', negated: true},
|
||||
];
|
||||
hash = hashchange.operators_to_hash(operators);
|
||||
assert.equal(hash, '#narrow/stream/devel/-topic/visual.20c.2B.2B');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
add_dependencies({
|
||||
Handlebars: 'handlebars',
|
||||
templates: 'js/templates',
|
||||
i18n: 'i18next'
|
||||
i18n: 'i18next',
|
||||
});
|
||||
|
||||
var i18n = global.i18n;
|
||||
@@ -10,17 +10,17 @@ i18n.init({
|
||||
keySeparator: false,
|
||||
interpolation: {
|
||||
prefix: "__",
|
||||
suffix: "__"
|
||||
suffix: "__",
|
||||
},
|
||||
lng: 'fr',
|
||||
resources: {
|
||||
fr: {
|
||||
translation: {
|
||||
Reply: "French",
|
||||
"You'll receive notifications when a message arrives and __page_params.product_name__ isn't in focus or the message is offscreen.": "Some French text with __page_params.product_name__"
|
||||
}
|
||||
}
|
||||
}
|
||||
"You'll receive notifications when a message arrives and __page_params.product_name__ isn't in focus or the message is offscreen.": "Some French text with __page_params.product_name__",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
var jsdom = require("jsdom");
|
||||
@@ -37,11 +37,11 @@ var _ = global._;
|
||||
id: "99",
|
||||
stream: "devel",
|
||||
subject: "testing",
|
||||
sender_full_name: "King Lear"
|
||||
sender_full_name: "King Lear",
|
||||
},
|
||||
can_edit_message: true,
|
||||
can_mute_topic: true,
|
||||
narrowed: true
|
||||
narrowed: true,
|
||||
};
|
||||
|
||||
var html = '<div style="height: 250px">';
|
||||
@@ -71,8 +71,8 @@ var _ = global._;
|
||||
enable_digest_emails: false,
|
||||
domain: "zulip.com",
|
||||
autoscroll_forever: false,
|
||||
default_desktop_notifications: false
|
||||
}
|
||||
default_desktop_notifications: false,
|
||||
},
|
||||
};
|
||||
|
||||
var html = global.render_template('settings_tab', args);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
add_dependencies({
|
||||
util: 'js/util.js',
|
||||
muting: 'js/muting.js',
|
||||
MessageListView: 'js/message_list_view.js'
|
||||
MessageListView: 'js/message_list_view.js',
|
||||
});
|
||||
|
||||
|
||||
@@ -27,17 +27,17 @@ var MessageList = require('js/message_list').MessageList;
|
||||
var messages = [
|
||||
{
|
||||
id: 50,
|
||||
content: 'fifty'
|
||||
content: 'fifty',
|
||||
},
|
||||
{
|
||||
id: 60
|
||||
id: 60,
|
||||
},
|
||||
{
|
||||
id: 70
|
||||
id: 70,
|
||||
},
|
||||
{
|
||||
id: 80
|
||||
}
|
||||
id: 80,
|
||||
},
|
||||
];
|
||||
|
||||
assert.equal(list.empty(), true);
|
||||
@@ -71,11 +71,11 @@ var MessageList = require('js/message_list').MessageList;
|
||||
|
||||
var old_messages = [
|
||||
{
|
||||
id: 30
|
||||
id: 30,
|
||||
},
|
||||
{
|
||||
id: 40
|
||||
}
|
||||
id: 40,
|
||||
},
|
||||
];
|
||||
list.prepend(old_messages, true);
|
||||
assert.equal(list.first().id, 30);
|
||||
@@ -83,8 +83,8 @@ var MessageList = require('js/message_list').MessageList;
|
||||
|
||||
var new_messages = [
|
||||
{
|
||||
id: 90
|
||||
}
|
||||
id: 90,
|
||||
},
|
||||
];
|
||||
list.append(new_messages, true);
|
||||
assert.equal(list.last().id, 90);
|
||||
|
||||
@@ -4,11 +4,11 @@ var MessageListView = require('js/message_list_view.js');
|
||||
add_dependencies({
|
||||
$: 'jquery',
|
||||
XDate: 'third/xdate/xdate.dev.js',
|
||||
util: 'js/util.js'
|
||||
util: 'js/util.js',
|
||||
});
|
||||
|
||||
set_global('page_params', {
|
||||
twenty_four_hour_time: false
|
||||
twenty_four_hour_time: false,
|
||||
});
|
||||
set_global('home_msg_list', null);
|
||||
set_global('feature_flags', {twenty_four_hour_time: false});
|
||||
@@ -22,7 +22,7 @@ set_global('timerender', {
|
||||
return [{outerHTML: String(time1.getTime())}];
|
||||
}
|
||||
return [{outerHTML: String(time1.getTime()) + ' - ' + String(time2.getTime())}];
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
(function test_merge_message_groups() {
|
||||
@@ -37,7 +37,7 @@ set_global('timerender', {
|
||||
message = {};
|
||||
}
|
||||
message_context = _.defaults(message_context, {
|
||||
include_sender: true
|
||||
include_sender: true,
|
||||
});
|
||||
message_context.msg = _.defaults(message, {
|
||||
id: _.uniqueId('test_message_'),
|
||||
@@ -46,7 +46,7 @@ set_global('timerender', {
|
||||
stream: 'Test Stream 1',
|
||||
subject: 'Test Subject 1',
|
||||
sender_email: 'test@example.com',
|
||||
timestamp: _.uniqueId()
|
||||
timestamp: _.uniqueId(),
|
||||
});
|
||||
return message_context;
|
||||
}
|
||||
@@ -55,7 +55,7 @@ set_global('timerender', {
|
||||
return {
|
||||
message_containers: messages,
|
||||
message_group_id: _.uniqueId('test_message_group_'),
|
||||
show_date: true
|
||||
show_date: true,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ set_global('timerender', {
|
||||
list._message_groups = message_groups;
|
||||
list.list = {
|
||||
unsubscribed_bookend_content: function () {},
|
||||
subscribed_bookend_content: function () {}
|
||||
subscribed_bookend_content: function () {},
|
||||
};
|
||||
return list;
|
||||
}
|
||||
@@ -72,8 +72,7 @@ set_global('timerender', {
|
||||
function assert_message_list_equal(list1, list2) {
|
||||
assert.deepEqual(
|
||||
_.chain(list1).pluck('msg').pluck('id').value(),
|
||||
_.chain(list2).pluck('msg').pluck('id').value()
|
||||
);
|
||||
_.chain(list2).pluck('msg').pluck('id').value());
|
||||
}
|
||||
|
||||
function assert_message_groups_list_equal(list1, list2) {
|
||||
@@ -85,14 +84,13 @@ set_global('timerender', {
|
||||
}
|
||||
assert.deepEqual(
|
||||
_.map(list1, extract_message_ids),
|
||||
_.map(list2, extract_message_ids)
|
||||
);
|
||||
_.map(list2, extract_message_ids));
|
||||
}
|
||||
|
||||
(function test_empty_list_bottom() {
|
||||
var list = build_list([]);
|
||||
var message_group = build_message_group([
|
||||
build_message_context()
|
||||
build_message_context(),
|
||||
]);
|
||||
|
||||
var result = list.merge_message_groups([message_group], 'bottom');
|
||||
@@ -109,12 +107,12 @@ set_global('timerender', {
|
||||
|
||||
var message1 = build_message_context();
|
||||
var message_group1 = build_message_group([
|
||||
message1
|
||||
message1,
|
||||
]);
|
||||
|
||||
var message2 = build_message_context();
|
||||
var message_group2 = build_message_group([
|
||||
message2
|
||||
message2,
|
||||
]);
|
||||
|
||||
var list = build_list([message_group1]);
|
||||
@@ -122,8 +120,7 @@ set_global('timerender', {
|
||||
|
||||
assert_message_groups_list_equal(
|
||||
list._message_groups,
|
||||
[build_message_group([message1, message2])]
|
||||
);
|
||||
[build_message_group([message1, message2])]);
|
||||
assert_message_groups_list_equal(result.append_groups, []);
|
||||
assert_message_groups_list_equal(result.prepend_groups, []);
|
||||
assert_message_groups_list_equal(result.rerender_groups, []);
|
||||
@@ -135,12 +132,12 @@ set_global('timerender', {
|
||||
|
||||
var message1 = build_message_context();
|
||||
var message_group1 = build_message_group([
|
||||
message1
|
||||
message1,
|
||||
]);
|
||||
|
||||
var message2 = build_message_context({subject: 'Test subject 2'});
|
||||
var message_group2 = build_message_group([
|
||||
message2
|
||||
message2,
|
||||
]);
|
||||
|
||||
var list = build_list([message_group1]);
|
||||
@@ -149,8 +146,7 @@ set_global('timerender', {
|
||||
assert(!message_group2.show_date);
|
||||
assert_message_groups_list_equal(
|
||||
list._message_groups,
|
||||
[message_group1, message_group2]
|
||||
);
|
||||
[message_group1, message_group2]);
|
||||
assert_message_groups_list_equal(result.append_groups, [message_group2]);
|
||||
assert_message_groups_list_equal(result.prepend_groups, []);
|
||||
assert_message_groups_list_equal(result.rerender_groups, []);
|
||||
@@ -162,12 +158,12 @@ set_global('timerender', {
|
||||
|
||||
var message1 = build_message_context({timestamp: 1000});
|
||||
var message_group1 = build_message_group([
|
||||
message1
|
||||
message1,
|
||||
]);
|
||||
|
||||
var message2 = build_message_context({timestamp: 900000});
|
||||
var message_group2 = build_message_group([
|
||||
message2
|
||||
message2,
|
||||
]);
|
||||
|
||||
var list = build_list([message_group1]);
|
||||
@@ -176,8 +172,7 @@ set_global('timerender', {
|
||||
assert(message_group2.show_date);
|
||||
assert_message_groups_list_equal(
|
||||
list._message_groups,
|
||||
[message_group1, message_group2]
|
||||
);
|
||||
[message_group1, message_group2]);
|
||||
assert_message_groups_list_equal(result.append_groups, [message_group2]);
|
||||
assert_message_groups_list_equal(result.prepend_groups, []);
|
||||
assert_message_groups_list_equal(result.rerender_groups, []);
|
||||
@@ -189,12 +184,12 @@ set_global('timerender', {
|
||||
|
||||
var message1 = build_message_context({historical: false});
|
||||
var message_group1 = build_message_group([
|
||||
message1
|
||||
message1,
|
||||
]);
|
||||
|
||||
var message2 = build_message_context({historical: true});
|
||||
var message_group2 = build_message_group([
|
||||
message2
|
||||
message2,
|
||||
]);
|
||||
|
||||
var list = build_list([message_group1]);
|
||||
@@ -203,8 +198,7 @@ set_global('timerender', {
|
||||
assert(message_group1.bookend_bottom);
|
||||
assert_message_groups_list_equal(
|
||||
list._message_groups,
|
||||
[message_group1, message_group2]
|
||||
);
|
||||
[message_group1, message_group2]);
|
||||
assert_message_groups_list_equal(result.append_groups, [message_group2]);
|
||||
assert_message_groups_list_equal(result.prepend_groups, []);
|
||||
assert_message_groups_list_equal(result.rerender_groups, []);
|
||||
@@ -216,12 +210,12 @@ set_global('timerender', {
|
||||
|
||||
var message1 = build_message_context();
|
||||
var message_group1 = build_message_group([
|
||||
message1
|
||||
message1,
|
||||
]);
|
||||
|
||||
var message2 = build_message_context({is_me_message: true});
|
||||
var message_group2 = build_message_group([
|
||||
message2
|
||||
message2,
|
||||
]);
|
||||
|
||||
var list = build_list([message_group1]);
|
||||
@@ -230,8 +224,7 @@ set_global('timerender', {
|
||||
assert(message2.include_sender);
|
||||
assert_message_groups_list_equal(
|
||||
list._message_groups,
|
||||
[build_message_group([message1, message2])]
|
||||
);
|
||||
[build_message_group([message1, message2])]);
|
||||
assert_message_groups_list_equal(result.append_groups, []);
|
||||
assert_message_groups_list_equal(result.prepend_groups, []);
|
||||
assert_message_groups_list_equal(result.rerender_groups, []);
|
||||
@@ -244,12 +237,12 @@ set_global('timerender', {
|
||||
|
||||
var message1 = build_message_context();
|
||||
var message_group1 = build_message_group([
|
||||
message1
|
||||
message1,
|
||||
]);
|
||||
|
||||
var message2 = build_message_context();
|
||||
var message_group2 = build_message_group([
|
||||
message2
|
||||
message2,
|
||||
]);
|
||||
|
||||
var list = build_list([message_group1]);
|
||||
@@ -257,13 +250,11 @@ set_global('timerender', {
|
||||
|
||||
assert_message_groups_list_equal(
|
||||
list._message_groups,
|
||||
[build_message_group([message2, message1])]
|
||||
);
|
||||
[build_message_group([message2, message1])]);
|
||||
assert_message_groups_list_equal(result.append_groups, []);
|
||||
assert_message_groups_list_equal(result.prepend_groups, []);
|
||||
assert_message_groups_list_equal(result.rerender_groups,
|
||||
[build_message_group([message2, message1])]
|
||||
);
|
||||
[build_message_group([message2, message1])]);
|
||||
assert_message_list_equal(result.append_messages, []);
|
||||
assert_message_list_equal(result.rerender_messages, []);
|
||||
}());
|
||||
@@ -272,12 +263,12 @@ set_global('timerender', {
|
||||
|
||||
var message1 = build_message_context();
|
||||
var message_group1 = build_message_group([
|
||||
message1
|
||||
message1,
|
||||
]);
|
||||
|
||||
var message2 = build_message_context({subject: 'Test Subject 2'});
|
||||
var message_group2 = build_message_group([
|
||||
message2
|
||||
message2,
|
||||
]);
|
||||
|
||||
var list = build_list([message_group1]);
|
||||
@@ -285,8 +276,7 @@ set_global('timerender', {
|
||||
|
||||
assert_message_groups_list_equal(
|
||||
list._message_groups,
|
||||
[message_group2, message_group1]
|
||||
);
|
||||
[message_group2, message_group1]);
|
||||
assert_message_groups_list_equal(result.append_groups, []);
|
||||
assert_message_groups_list_equal(result.prepend_groups, [message_group2]);
|
||||
assert_message_groups_list_equal(result.rerender_groups, []);
|
||||
@@ -298,12 +288,12 @@ set_global('timerender', {
|
||||
|
||||
var message1 = build_message_context({timestamp: 900000});
|
||||
var message_group1 = build_message_group([
|
||||
message1
|
||||
message1,
|
||||
]);
|
||||
|
||||
var message2 = build_message_context({timestamp: 1000});
|
||||
var message_group2 = build_message_group([
|
||||
message2
|
||||
message2,
|
||||
]);
|
||||
|
||||
var list = build_list([message_group1]);
|
||||
@@ -311,12 +301,10 @@ set_global('timerender', {
|
||||
|
||||
assert.equal(
|
||||
message_group1.show_date,
|
||||
'900000000 - 1000000'
|
||||
);
|
||||
'900000000 - 1000000');
|
||||
assert_message_groups_list_equal(
|
||||
list._message_groups,
|
||||
[message_group2, message_group1]
|
||||
);
|
||||
[message_group2, message_group1]);
|
||||
assert_message_groups_list_equal(result.append_groups, []);
|
||||
assert_message_groups_list_equal(result.prepend_groups, [message_group2]);
|
||||
assert_message_groups_list_equal(result.rerender_groups, [message_group1]);
|
||||
@@ -328,12 +316,12 @@ set_global('timerender', {
|
||||
|
||||
var message1 = build_message_context({historical: false});
|
||||
var message_group1 = build_message_group([
|
||||
message1
|
||||
message1,
|
||||
]);
|
||||
|
||||
var message2 = build_message_context({historical: true});
|
||||
var message_group2 = build_message_group([
|
||||
message2
|
||||
message2,
|
||||
]);
|
||||
|
||||
var list = build_list([message_group1]);
|
||||
@@ -342,8 +330,7 @@ set_global('timerender', {
|
||||
assert(message_group2.bookend_bottom);
|
||||
assert_message_groups_list_equal(
|
||||
list._message_groups,
|
||||
[message_group2, message_group1]
|
||||
);
|
||||
[message_group2, message_group1]);
|
||||
assert_message_groups_list_equal(result.append_groups, []);
|
||||
assert_message_groups_list_equal(result.prepend_groups, [message_group2]);
|
||||
assert_message_groups_list_equal(result.rerender_groups, []);
|
||||
|
||||
@@ -2,42 +2,42 @@ global.stub_out_jquery();
|
||||
|
||||
add_dependencies({
|
||||
people: 'js/people.js',
|
||||
util: 'js/util.js'
|
||||
util: 'js/util.js',
|
||||
});
|
||||
|
||||
var noop = function () {};
|
||||
var people = global.people;
|
||||
|
||||
set_global('page_params', {
|
||||
email: 'me@example.com'
|
||||
email: 'me@example.com',
|
||||
});
|
||||
|
||||
set_global('alert_words', {
|
||||
process_message: noop
|
||||
process_message: noop,
|
||||
});
|
||||
|
||||
var me = {
|
||||
email: 'me@example.com',
|
||||
user_id: 101,
|
||||
full_name: 'Me Myself'
|
||||
full_name: 'Me Myself',
|
||||
};
|
||||
|
||||
var alice = {
|
||||
email: 'alice@example.com',
|
||||
user_id: 102,
|
||||
full_name: 'Alice'
|
||||
full_name: 'Alice',
|
||||
};
|
||||
|
||||
var bob = {
|
||||
email: 'bob@example.com',
|
||||
user_id: 103,
|
||||
full_name: 'Bob'
|
||||
full_name: 'Bob',
|
||||
};
|
||||
|
||||
var cindy = {
|
||||
email: 'cindy@example.com',
|
||||
user_id: 104,
|
||||
full_name: 'Cindy'
|
||||
full_name: 'Cindy',
|
||||
};
|
||||
|
||||
people.add_in_realm(me);
|
||||
@@ -54,7 +54,7 @@ var message_store = require('js/message_store.js');
|
||||
sender_email: 'me@example.com',
|
||||
type: 'private',
|
||||
display_recipient: [me, bob, cindy],
|
||||
flags: ['has_alert_word']
|
||||
flags: ['has_alert_word'],
|
||||
};
|
||||
message_store._add_message_metadata(message);
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
set_global('page_params', {
|
||||
domain: 'zulip.com'
|
||||
domain: 'zulip.com',
|
||||
});
|
||||
add_dependencies({
|
||||
unread: 'js/unread.js'
|
||||
unread: 'js/unread.js',
|
||||
});
|
||||
|
||||
var muting = require('js/muting.js');
|
||||
@@ -42,16 +42,16 @@ var muting = require('js/muting.js');
|
||||
muting.mute_topic('devel', 'java');
|
||||
assert.deepEqual(muting.get_muted_topics().sort(), [
|
||||
['devel', 'java'],
|
||||
['office', 'gossip']
|
||||
['office', 'gossip'],
|
||||
]);
|
||||
|
||||
muting.set_muted_topics([
|
||||
['social', 'breakfast'],
|
||||
['design', 'typography']
|
||||
['design', 'typography'],
|
||||
]);
|
||||
assert.deepEqual(muting.get_muted_topics().sort(), [
|
||||
['design', 'typography'],
|
||||
['social', 'breakfast']
|
||||
['social', 'breakfast'],
|
||||
]);
|
||||
}());
|
||||
|
||||
@@ -59,7 +59,7 @@ var muting = require('js/muting.js');
|
||||
muting.set_muted_topics([]);
|
||||
assert(!muting.is_topic_muted('SOCial', 'breakfast'));
|
||||
muting.set_muted_topics([
|
||||
['SOCial', 'breakfast']
|
||||
['SOCial', 'breakfast'],
|
||||
]);
|
||||
assert(muting.is_topic_muted('SOCial', 'breakfast'));
|
||||
assert(muting.is_topic_muted('social', 'breakfast'));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
add_dependencies({
|
||||
stream_data: 'js/stream_data.js',
|
||||
Filter: 'js/filter.js'
|
||||
Filter: 'js/filter.js',
|
||||
});
|
||||
|
||||
var narrow = require('js/narrow.js');
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
add_dependencies({
|
||||
util: 'js/util.js'
|
||||
util: 'js/util.js',
|
||||
});
|
||||
|
||||
global.stub_out_jquery();
|
||||
@@ -8,13 +8,13 @@ var people = require("js/people.js");
|
||||
|
||||
set_global('page_params', {
|
||||
people_list: [],
|
||||
email: 'hamlet@example.com'
|
||||
email: 'hamlet@example.com',
|
||||
});
|
||||
set_global('activity', {
|
||||
set_user_statuses: function () {}
|
||||
set_user_statuses: function () {},
|
||||
});
|
||||
set_global('admin', {
|
||||
show_or_hide_menu_item: function () {}
|
||||
show_or_hide_menu_item: function () {},
|
||||
});
|
||||
|
||||
var _ = global._;
|
||||
@@ -23,7 +23,7 @@ var _ = global._;
|
||||
var orig_person = {
|
||||
email: 'orig@example.com',
|
||||
user_id: 31,
|
||||
full_name: 'Original'
|
||||
full_name: 'Original',
|
||||
};
|
||||
people.add(orig_person);
|
||||
|
||||
@@ -40,7 +40,7 @@ var _ = global._;
|
||||
var isaac = {
|
||||
email: email,
|
||||
user_id: 32,
|
||||
full_name: full_name
|
||||
full_name: full_name,
|
||||
};
|
||||
people.add(isaac);
|
||||
|
||||
@@ -91,7 +91,7 @@ var _ = global._;
|
||||
var person = {
|
||||
email: 'mary@example.com',
|
||||
user_id: 42,
|
||||
full_name: 'Mary'
|
||||
full_name: 'Mary',
|
||||
};
|
||||
people.add(person);
|
||||
person = people.get_by_email('mary@example.com');
|
||||
@@ -107,7 +107,7 @@ var _ = global._;
|
||||
person = {
|
||||
email: 'mary@example.com',
|
||||
user_id: 42,
|
||||
full_name: 'Mary New'
|
||||
full_name: 'Mary New',
|
||||
};
|
||||
people.update(person);
|
||||
person = people.get_person_from_user_id(42);
|
||||
@@ -126,23 +126,23 @@ var _ = global._;
|
||||
var myself = {
|
||||
email: 'myself@example.com',
|
||||
user_id: 201,
|
||||
full_name: 'Yours Truly'
|
||||
full_name: 'Yours Truly',
|
||||
};
|
||||
global.page_params.email = myself.email;
|
||||
var alice1 = {
|
||||
email: 'alice1@example.com',
|
||||
user_id: 202,
|
||||
full_name: 'Alice'
|
||||
full_name: 'Alice',
|
||||
};
|
||||
var alice2 = {
|
||||
email: 'alice2@example.com',
|
||||
user_id: 203,
|
||||
full_name: 'Alice'
|
||||
full_name: 'Alice',
|
||||
};
|
||||
var bob = {
|
||||
email: 'bob@example.com',
|
||||
user_id: 204,
|
||||
full_name: 'Bob van Roberts'
|
||||
full_name: 'Bob van Roberts',
|
||||
};
|
||||
people.add_in_realm(myself);
|
||||
people.add_in_realm(alice1);
|
||||
@@ -152,7 +152,7 @@ var _ = global._;
|
||||
var expected = [
|
||||
{ email: 'alice1@example.com', full_name: 'Alice' },
|
||||
{ email: 'alice2@example.com', full_name: 'Alice' },
|
||||
{ email: 'bob@example.com', full_name: 'Bob van Roberts' }
|
||||
{ email: 'bob@example.com', full_name: 'Bob van Roberts' },
|
||||
];
|
||||
assert.deepEqual(others, expected);
|
||||
|
||||
@@ -175,22 +175,22 @@ var _ = global._;
|
||||
var charles = {
|
||||
email: 'charles@example.com',
|
||||
user_id: 301,
|
||||
full_name: 'Charles Dickens'
|
||||
full_name: 'Charles Dickens',
|
||||
};
|
||||
var maria = {
|
||||
email: 'athens@example.com',
|
||||
user_id: 302,
|
||||
full_name: 'Maria Athens'
|
||||
full_name: 'Maria Athens',
|
||||
};
|
||||
var ashton = {
|
||||
email: 'ashton@example.com',
|
||||
user_id: 303,
|
||||
full_name: 'Ashton Smith'
|
||||
full_name: 'Ashton Smith',
|
||||
};
|
||||
var linus = {
|
||||
email: 'ltorvalds@example.com',
|
||||
user_id: 304,
|
||||
full_name: 'Linus Torvalds'
|
||||
full_name: 'Linus Torvalds',
|
||||
};
|
||||
|
||||
people.add_in_realm(charles);
|
||||
@@ -203,7 +203,7 @@ var _ = global._;
|
||||
var filtered_people = people.filter_people_by_search_terms(users, [search_term]);
|
||||
var expected = [
|
||||
{ email: 'athens@example.com', full_name: 'Maria Athens' },
|
||||
{ email: 'ashton@example.com', full_name: 'Ashton Smith' }
|
||||
{ email: 'ashton@example.com', full_name: 'Ashton Smith' },
|
||||
];
|
||||
assert.equal(filtered_people["ashton@example.com"], true);
|
||||
assert.equal(filtered_people["athens@example.com"], true);
|
||||
@@ -232,12 +232,12 @@ var _ = global._;
|
||||
var emp401 = {
|
||||
email: 'emp401@example.com',
|
||||
user_id: 401,
|
||||
full_name: 'whatever 401'
|
||||
full_name: 'whatever 401',
|
||||
};
|
||||
var emp402 = {
|
||||
email: 'EMP402@example.com',
|
||||
user_id: 402,
|
||||
full_name: 'whatever 402'
|
||||
full_name: 'whatever 402',
|
||||
};
|
||||
|
||||
people.add_in_realm(emp401);
|
||||
|
||||
@@ -4,7 +4,7 @@ global.stub_out_jquery();
|
||||
set_global('document', {
|
||||
hasFocus: function () {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
});
|
||||
set_global('feature_flags', {});
|
||||
set_global('page_params', {});
|
||||
@@ -16,7 +16,7 @@ add_dependencies({
|
||||
compose_fade: 'js/compose_fade.js',
|
||||
people: 'js/people.js',
|
||||
unread: 'js/unread.js',
|
||||
activity: 'js/activity.js'
|
||||
activity: 'js/activity.js',
|
||||
});
|
||||
|
||||
var compose_fade = require('js/compose_fade.js');
|
||||
@@ -42,27 +42,27 @@ var activity = require('js/activity.js');
|
||||
var alice = {
|
||||
email: 'alice@zulip.com',
|
||||
user_id: 1,
|
||||
full_name: 'Alice Smith'
|
||||
full_name: 'Alice Smith',
|
||||
};
|
||||
var fred = {
|
||||
email: 'fred@zulip.com',
|
||||
user_id: 2,
|
||||
full_name: "Fred Flintstone"
|
||||
full_name: "Fred Flintstone",
|
||||
};
|
||||
var jill = {
|
||||
email: 'jill@zulip.com',
|
||||
user_id: 3,
|
||||
full_name: 'Jill Hill'
|
||||
full_name: 'Jill Hill',
|
||||
};
|
||||
var mark = {
|
||||
email: 'mark@zulip.com',
|
||||
user_id: 4,
|
||||
full_name: 'Marky Mark'
|
||||
full_name: 'Marky Mark',
|
||||
};
|
||||
var norbert = {
|
||||
email: 'norbert@zulip.com',
|
||||
user_id: 5,
|
||||
full_name: 'Norbert Oswald'
|
||||
full_name: 'Norbert Oswald',
|
||||
};
|
||||
|
||||
global.people.add(alice);
|
||||
@@ -112,7 +112,7 @@ activity.presence_info[norbert.user_id] = {status: activity.ACTIVE};
|
||||
num_unread: 0,
|
||||
type: 'idle',
|
||||
type_desc: 'is not active',
|
||||
mobile: undefined }
|
||||
mobile: undefined },
|
||||
]);
|
||||
}());
|
||||
|
||||
@@ -130,7 +130,7 @@ activity.presence_info[norbert.user_id] = {status: activity.ACTIVE};
|
||||
num_unread: 0,
|
||||
type: 'active',
|
||||
type_desc: 'is active',
|
||||
mobile: undefined }
|
||||
mobile: undefined },
|
||||
]);
|
||||
|
||||
// Test if user index in presence_info is the expected one
|
||||
@@ -147,7 +147,7 @@ activity.presence_info[norbert.user_id] = {status: activity.ACTIVE};
|
||||
num_unread: 0,
|
||||
type: 'active',
|
||||
type_desc: 'is active',
|
||||
mobile: undefined }
|
||||
mobile: undefined },
|
||||
]);
|
||||
|
||||
all_users = activity._filter_and_sort(activity.presence_info);
|
||||
|
||||
@@ -14,7 +14,7 @@ add_dependencies({
|
||||
typeahead_helper: 'js/typeahead_helper.js',
|
||||
people: 'js/people.js',
|
||||
stream_data: 'js/stream_data.js',
|
||||
narrow: 'js/narrow.js'
|
||||
narrow: 'js/narrow.js',
|
||||
});
|
||||
|
||||
var people = global.people;
|
||||
@@ -22,7 +22,7 @@ var people = global.people;
|
||||
var search = require('js/search_suggestion.js');
|
||||
|
||||
set_global('page_params', {
|
||||
email: 'bob@zulip.com'
|
||||
email: 'bob@zulip.com',
|
||||
});
|
||||
|
||||
set_global('narrow', {});
|
||||
@@ -43,7 +43,7 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
var suggestions = search.get_suggestions(query);
|
||||
|
||||
var expected = [
|
||||
'fred'
|
||||
'fred',
|
||||
];
|
||||
assert.deepEqual(suggestions.strings, expected);
|
||||
}());
|
||||
@@ -64,7 +64,7 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
var expected = [
|
||||
"stream:Denmark topic:Hamlet shakespeare",
|
||||
"stream:Denmark topic:Hamlet",
|
||||
"stream:Denmark"
|
||||
"stream:Denmark",
|
||||
];
|
||||
|
||||
assert.deepEqual(suggestions.strings, expected);
|
||||
@@ -83,14 +83,14 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
{
|
||||
email: 'ted@zulip.com',
|
||||
user_id: 101,
|
||||
full_name: 'Ted Smith'
|
||||
full_name: 'Ted Smith',
|
||||
};
|
||||
|
||||
var alice =
|
||||
{
|
||||
email: 'alice@zulip.com',
|
||||
user_id: 102,
|
||||
full_name: 'Alice Ignore'
|
||||
full_name: 'Alice Ignore',
|
||||
};
|
||||
|
||||
people.add(ted);
|
||||
@@ -101,7 +101,7 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
var expected = [
|
||||
"is:private",
|
||||
"pm-with:alice@zulip.com",
|
||||
"pm-with:ted@zulip.com"
|
||||
"pm-with:ted@zulip.com",
|
||||
];
|
||||
assert.deepEqual(suggestions.strings, expected);
|
||||
|
||||
@@ -110,7 +110,7 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
expected = [
|
||||
"is:private al",
|
||||
"pm-with:alice@zulip.com",
|
||||
"is:private"
|
||||
"is:private",
|
||||
];
|
||||
assert.deepEqual(suggestions.strings, expected);
|
||||
|
||||
@@ -119,7 +119,7 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
expected = [
|
||||
"pm-with:t",
|
||||
"pm-with:ted@zulip.com",
|
||||
"is:private"
|
||||
"is:private",
|
||||
];
|
||||
assert.deepEqual(suggestions.strings, expected);
|
||||
|
||||
@@ -128,7 +128,7 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
expected = [
|
||||
"-pm-with:t",
|
||||
"is:private -pm-with:ted@zulip.com",
|
||||
"is:private"
|
||||
"is:private",
|
||||
];
|
||||
assert.deepEqual(suggestions.strings, expected);
|
||||
|
||||
@@ -136,7 +136,7 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
suggestions = search.get_suggestions(query);
|
||||
expected = [
|
||||
"pm-with:ted@zulip.com",
|
||||
"is:private"
|
||||
"is:private",
|
||||
];
|
||||
assert.deepEqual(suggestions.strings, expected);
|
||||
|
||||
@@ -145,7 +145,7 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
expected = [
|
||||
"sender:ted",
|
||||
"sender:ted@zulip.com",
|
||||
"is:private"
|
||||
"is:private",
|
||||
];
|
||||
assert.deepEqual(suggestions.strings, expected);
|
||||
|
||||
@@ -154,7 +154,7 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
expected = [
|
||||
"sender:te",
|
||||
"sender:ted@zulip.com",
|
||||
"is:private"
|
||||
"is:private",
|
||||
];
|
||||
assert.deepEqual(suggestions.strings, expected);
|
||||
|
||||
@@ -163,7 +163,7 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
expected = [
|
||||
"-sender:te",
|
||||
"is:private -sender:ted@zulip.com",
|
||||
"is:private"
|
||||
"is:private",
|
||||
];
|
||||
assert.deepEqual(suggestions.strings, expected);
|
||||
|
||||
@@ -171,7 +171,7 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
suggestions = search.get_suggestions(query);
|
||||
expected = [
|
||||
"sender:ted@zulip.com",
|
||||
"is:private"
|
||||
"is:private",
|
||||
];
|
||||
assert.deepEqual(suggestions.strings, expected);
|
||||
|
||||
@@ -181,7 +181,7 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
suggestions = search.get_suggestions(query);
|
||||
expected = [
|
||||
"is:private near:3",
|
||||
"is:private"
|
||||
"is:private",
|
||||
];
|
||||
assert.deepEqual(suggestions.strings, expected);
|
||||
|
||||
@@ -189,7 +189,7 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
suggestions = search.get_suggestions(query);
|
||||
expected = [
|
||||
"pm-with:ted@zulip.com near:3",
|
||||
"pm-with:ted@zulip.com"
|
||||
"pm-with:ted@zulip.com",
|
||||
];
|
||||
assert.deepEqual(suggestions.strings, expected);
|
||||
|
||||
@@ -219,7 +219,7 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
"is:alerted",
|
||||
"sender:bob@zulip.com",
|
||||
"stream:devel",
|
||||
"stream:office"
|
||||
"stream:office",
|
||||
];
|
||||
|
||||
assert.deepEqual(suggestions.strings, expected);
|
||||
@@ -250,20 +250,20 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
|
||||
global.stream_data.populate_stream_topics_for_tests({
|
||||
devel: [
|
||||
{subject: 'REXX'}
|
||||
{subject: 'REXX'},
|
||||
],
|
||||
office: [
|
||||
{subject: 'team'},
|
||||
{subject: 'ignore'},
|
||||
{subject: 'test'}
|
||||
]
|
||||
{subject: 'test'},
|
||||
],
|
||||
});
|
||||
|
||||
suggestions = search.get_suggestions('te');
|
||||
expected = [
|
||||
"te",
|
||||
"stream:office topic:team",
|
||||
"stream:office topic:test"
|
||||
"stream:office topic:test",
|
||||
];
|
||||
assert.deepEqual(suggestions.strings, expected);
|
||||
|
||||
@@ -276,7 +276,7 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
suggestions = search.get_suggestions('topic:staplers stream:office');
|
||||
expected = [
|
||||
'topic:staplers stream:office',
|
||||
'topic:staplers'
|
||||
'topic:staplers',
|
||||
];
|
||||
assert.deepEqual(suggestions.strings, expected);
|
||||
|
||||
@@ -284,7 +284,7 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
expected = [
|
||||
'stream:devel topic:',
|
||||
'stream:devel topic:REXX',
|
||||
'stream:devel'
|
||||
'stream:devel',
|
||||
];
|
||||
assert.deepEqual(suggestions.strings, expected);
|
||||
|
||||
@@ -292,7 +292,7 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
expected = [
|
||||
'stream:devel -topic:',
|
||||
'stream:devel -topic:REXX',
|
||||
'stream:devel'
|
||||
'stream:devel',
|
||||
];
|
||||
assert.deepEqual(suggestions.strings, expected);
|
||||
|
||||
@@ -300,7 +300,7 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
expected = [
|
||||
'-topic:te',
|
||||
'stream:office -topic:team',
|
||||
'stream:office -topic:test'
|
||||
'stream:office -topic:test',
|
||||
];
|
||||
assert.deepEqual(suggestions.strings, expected);
|
||||
}());
|
||||
@@ -321,7 +321,7 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
var suggestions = search.get_suggestions(query);
|
||||
|
||||
var expected = [
|
||||
"stream:office"
|
||||
"stream:office",
|
||||
];
|
||||
|
||||
assert.deepEqual(suggestions.strings, expected);
|
||||
@@ -344,7 +344,7 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
|
||||
var expected = [
|
||||
"stream:of",
|
||||
"stream:office"
|
||||
"stream:office",
|
||||
];
|
||||
|
||||
assert.deepEqual(suggestions.strings, expected);
|
||||
@@ -364,19 +364,19 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
var ted = {
|
||||
email: 'ted@zulip.com',
|
||||
user_id: 201,
|
||||
full_name: 'Ted Smith'
|
||||
full_name: 'Ted Smith',
|
||||
};
|
||||
|
||||
var bob = {
|
||||
email: 'bob@zulip.com',
|
||||
user_id: 202,
|
||||
full_name: 'Bob Terry'
|
||||
full_name: 'Bob Terry',
|
||||
};
|
||||
|
||||
var alice = {
|
||||
email: 'alice@zulip.com',
|
||||
user_id: 203,
|
||||
full_name: 'Alice Ignore'
|
||||
full_name: 'Alice Ignore',
|
||||
};
|
||||
people.add(ted);
|
||||
people.add(bob);
|
||||
@@ -387,8 +387,8 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
office: [
|
||||
{subject: 'team'},
|
||||
{subject: 'ignore'},
|
||||
{subject: 'test'}
|
||||
]
|
||||
{subject: 'test'},
|
||||
],
|
||||
});
|
||||
|
||||
var suggestions = search.get_suggestions(query);
|
||||
@@ -398,7 +398,7 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
"pm-with:bob@zulip.com", // bob TErry
|
||||
"pm-with:ted@zulip.com",
|
||||
"sender:bob@zulip.com",
|
||||
"sender:ted@zulip.com"
|
||||
"sender:ted@zulip.com",
|
||||
];
|
||||
|
||||
assert.deepEqual(suggestions.strings, expected);
|
||||
@@ -415,7 +415,7 @@ global.stream_data.populate_stream_topics_for_tests({});
|
||||
expected = [
|
||||
"Ted",
|
||||
"pm-with:ted@zulip.com",
|
||||
"sender:ted@zulip.com"
|
||||
"sender:ted@zulip.com",
|
||||
];
|
||||
|
||||
assert.deepEqual(suggestions.strings, expected);
|
||||
|
||||
@@ -3,14 +3,14 @@ var _ = global._;
|
||||
|
||||
add_dependencies({
|
||||
util: 'js/util.js',
|
||||
tutorial: 'js/tutorial.js'
|
||||
tutorial: 'js/tutorial.js',
|
||||
});
|
||||
|
||||
var noop = function () {};
|
||||
|
||||
set_global('document', {});
|
||||
set_global('window', {
|
||||
addEventListener: noop
|
||||
addEventListener: noop,
|
||||
});
|
||||
|
||||
global.stub_out_jquery();
|
||||
@@ -19,11 +19,11 @@ set_global('blueslip', {});
|
||||
set_global('channel', {});
|
||||
set_global('home_msg_list', {
|
||||
select_id: noop,
|
||||
selected_id: function () {return 1;}
|
||||
selected_id: function () {return 1;},
|
||||
});
|
||||
set_global('page_params', {test_suite: false});
|
||||
set_global('reload', {
|
||||
is_in_progress: function () {return false;}
|
||||
is_in_progress: function () {return false;},
|
||||
});
|
||||
|
||||
var page_params = global.page_params;
|
||||
@@ -32,7 +32,7 @@ set_global('echo', {
|
||||
process_from_server: function (messages) {
|
||||
return messages;
|
||||
},
|
||||
set_realm_filters: noop
|
||||
set_realm_filters: noop,
|
||||
});
|
||||
|
||||
var server_events = require('js/server_events.js');
|
||||
@@ -47,12 +47,12 @@ var setup = function (results) {
|
||||
},
|
||||
update_messages: function () {
|
||||
throw Error('update error');
|
||||
}
|
||||
},
|
||||
});
|
||||
set_global('subs', {
|
||||
update_subscription_properties: function () {
|
||||
throw Error('subs update error');
|
||||
}
|
||||
},
|
||||
});
|
||||
global.blueslip.error = function (msg, more_info, stack) {
|
||||
results.msg = msg;
|
||||
|
||||
@@ -2,13 +2,13 @@ global.stub_out_jquery();
|
||||
|
||||
set_global('page_params', {
|
||||
is_admin: false,
|
||||
people_list: []
|
||||
people_list: [],
|
||||
});
|
||||
|
||||
add_dependencies({
|
||||
people: 'js/people.js',
|
||||
stream_color: 'js/stream_color.js',
|
||||
util: 'js/util.js'
|
||||
util: 'js/util.js',
|
||||
});
|
||||
|
||||
set_global('blueslip', {});
|
||||
@@ -22,7 +22,7 @@ var people = global.people;
|
||||
color: 'blue',
|
||||
name: 'Denmark',
|
||||
stream_id: 1,
|
||||
in_home_view: false
|
||||
in_home_view: false,
|
||||
};
|
||||
var social = {
|
||||
subscribed: true,
|
||||
@@ -30,7 +30,7 @@ var people = global.people;
|
||||
name: 'social',
|
||||
stream_id: 2,
|
||||
in_home_view: true,
|
||||
invite_only: true
|
||||
invite_only: true,
|
||||
};
|
||||
var test = {
|
||||
subscribed: true,
|
||||
@@ -38,7 +38,7 @@ var people = global.people;
|
||||
name: 'test',
|
||||
stream_id: 3,
|
||||
in_home_view: false,
|
||||
invite_only: false
|
||||
invite_only: false,
|
||||
};
|
||||
stream_data.add_sub('Denmark', denmark);
|
||||
stream_data.add_sub('social', social);
|
||||
@@ -77,7 +77,7 @@ var people = global.people;
|
||||
name: 'Denmark',
|
||||
subscribed: true,
|
||||
color: 'red',
|
||||
stream_id: id
|
||||
stream_id: id,
|
||||
};
|
||||
stream_data.add_sub('Denmark', sub);
|
||||
sub = stream_data.get_sub('Denmark');
|
||||
@@ -98,7 +98,7 @@ var people = global.people;
|
||||
var me = {
|
||||
email: 'me@zulip.com',
|
||||
full_name: 'Current User',
|
||||
user_id: 81
|
||||
user_id: 81,
|
||||
};
|
||||
|
||||
// set up user data
|
||||
@@ -132,17 +132,17 @@ var people = global.people;
|
||||
var fred = {
|
||||
email: 'fred@zulip.com',
|
||||
full_name: 'Fred',
|
||||
user_id: 101
|
||||
user_id: 101,
|
||||
};
|
||||
var not_fred = {
|
||||
email: 'not_fred@zulip.com',
|
||||
full_name: 'Not Fred',
|
||||
user_id: 102
|
||||
user_id: 102,
|
||||
};
|
||||
var george = {
|
||||
email: 'george@zulip.com',
|
||||
full_name: 'George',
|
||||
user_id: 103
|
||||
user_id: 103,
|
||||
};
|
||||
people.add(fred);
|
||||
people.add(not_fred);
|
||||
@@ -160,7 +160,7 @@ var people = global.people;
|
||||
var brutus = {
|
||||
email: email,
|
||||
full_name: 'Brutus',
|
||||
user_id: 104
|
||||
user_id: 104,
|
||||
};
|
||||
people.add(brutus);
|
||||
assert(!stream_data.user_is_subscribed('Rome', email));
|
||||
@@ -218,7 +218,7 @@ var people = global.people;
|
||||
var message = {
|
||||
stream: 'Rome',
|
||||
timestamp: 101,
|
||||
subject: 'toPic1'
|
||||
subject: 'toPic1',
|
||||
};
|
||||
stream_data.process_message_for_recent_topics(message);
|
||||
|
||||
@@ -228,14 +228,14 @@ var people = global.people;
|
||||
subject: 'toPic1',
|
||||
canon_subject: 'topic1',
|
||||
count: 1,
|
||||
timestamp: 101
|
||||
}
|
||||
timestamp: 101,
|
||||
},
|
||||
]);
|
||||
|
||||
message = {
|
||||
stream: 'Rome',
|
||||
timestamp: 102,
|
||||
subject: 'Topic1'
|
||||
subject: 'Topic1',
|
||||
};
|
||||
stream_data.process_message_for_recent_topics(message);
|
||||
history = stream_data.get_recent_topics('Rome');
|
||||
@@ -244,14 +244,14 @@ var people = global.people;
|
||||
subject: 'Topic1',
|
||||
canon_subject: 'topic1',
|
||||
count: 2,
|
||||
timestamp: 102
|
||||
}
|
||||
timestamp: 102,
|
||||
},
|
||||
]);
|
||||
|
||||
message = {
|
||||
stream: 'Rome',
|
||||
timestamp: 103,
|
||||
subject: 'topic2'
|
||||
subject: 'topic2',
|
||||
};
|
||||
stream_data.process_message_for_recent_topics(message);
|
||||
history = stream_data.get_recent_topics('Rome');
|
||||
@@ -260,14 +260,14 @@ var people = global.people;
|
||||
subject: 'topic2',
|
||||
canon_subject: 'topic2',
|
||||
count: 1,
|
||||
timestamp: 103
|
||||
timestamp: 103,
|
||||
},
|
||||
{
|
||||
subject: 'Topic1',
|
||||
canon_subject: 'topic1',
|
||||
count: 2,
|
||||
timestamp: 102
|
||||
}
|
||||
timestamp: 102,
|
||||
},
|
||||
]);
|
||||
|
||||
stream_data.process_message_for_recent_topics(message, true);
|
||||
@@ -277,8 +277,8 @@ var people = global.people;
|
||||
subject: 'Topic1',
|
||||
canon_subject: 'topic1',
|
||||
count: 2,
|
||||
timestamp: 102
|
||||
}
|
||||
timestamp: 102,
|
||||
},
|
||||
]);
|
||||
}());
|
||||
|
||||
@@ -290,7 +290,7 @@ var people = global.people;
|
||||
name: 'stream_to_admin',
|
||||
stream_id: 1,
|
||||
in_home_view: false,
|
||||
invite_only: false
|
||||
invite_only: false,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -339,21 +339,21 @@ var people = global.people;
|
||||
stream_id: 1,
|
||||
name: 'c',
|
||||
color: 'cinnamon',
|
||||
subscribed: true
|
||||
subscribed: true,
|
||||
};
|
||||
|
||||
var blue = {
|
||||
stream_id: 2,
|
||||
name: 'b',
|
||||
color: 'blue',
|
||||
subscribed: false
|
||||
subscribed: false,
|
||||
};
|
||||
|
||||
var amber = {
|
||||
stream_id: 3,
|
||||
name: 'a',
|
||||
color: 'amber',
|
||||
subscribed: true
|
||||
subscribed: true,
|
||||
};
|
||||
stream_data.clear_subscriptions();
|
||||
stream_data.add_sub(cinnamon.name, cinnamon);
|
||||
|
||||
@@ -10,12 +10,12 @@ add_dependencies({
|
||||
stream_data: 'js/stream_data',
|
||||
subs: 'js/subs',
|
||||
util: 'js/util',
|
||||
hashchange: 'js/hashchange'
|
||||
hashchange: 'js/hashchange',
|
||||
});
|
||||
|
||||
set_global('unread', {});
|
||||
set_global('message_store', {
|
||||
recent_private_messages: new global.Array()
|
||||
recent_private_messages: new global.Array(),
|
||||
});
|
||||
|
||||
// TODO: move pm_list-related tests to their own module
|
||||
@@ -37,12 +37,12 @@ global.compile_template('stream_privacy');
|
||||
var alice = {
|
||||
email: 'alice@zulip.com',
|
||||
user_id: 101,
|
||||
full_name: 'Alice'
|
||||
full_name: 'Alice',
|
||||
};
|
||||
var bob = {
|
||||
email: 'bob@zulip.com',
|
||||
user_id: 102,
|
||||
full_name: 'Bob'
|
||||
full_name: 'Bob',
|
||||
};
|
||||
global.people.add_in_realm(alice);
|
||||
global.people.add_in_realm(bob);
|
||||
@@ -88,7 +88,7 @@ function clear_filters() {
|
||||
stream_id: 100,
|
||||
color: 'blue',
|
||||
subscribed: true,
|
||||
id: 5
|
||||
id: 5,
|
||||
};
|
||||
global.stream_data.add_sub('devel', devel);
|
||||
|
||||
@@ -97,7 +97,7 @@ function clear_filters() {
|
||||
stream_id: 200,
|
||||
color: 'green',
|
||||
subscribed: true,
|
||||
id: 6
|
||||
id: 6,
|
||||
};
|
||||
global.stream_data.add_sub('social', social);
|
||||
|
||||
@@ -135,7 +135,7 @@ function clear_filters() {
|
||||
color: 'blue',
|
||||
id: 5,
|
||||
pin_to_top: false,
|
||||
subscribed: true
|
||||
subscribed: true,
|
||||
};
|
||||
stream_list.create_sidebar_row(develSub);
|
||||
global.stream_data.add_sub('devel', develSub);
|
||||
@@ -146,7 +146,7 @@ function clear_filters() {
|
||||
color: 'green',
|
||||
id: 6,
|
||||
pin_to_top: true,
|
||||
subscribed: true
|
||||
subscribed: true,
|
||||
};
|
||||
stream_list.create_sidebar_row(socialSub);
|
||||
global.stream_data.add_sub('social', socialSub);
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
set_global('page_params', {realm_emoji: {
|
||||
burrito: {display_url: '/static/third/gemoji/images/emoji/burrito.png',
|
||||
source_url: '/static/third/gemoji/images/emoji/burrito.png'}
|
||||
source_url: '/static/third/gemoji/images/emoji/burrito.png'},
|
||||
}});
|
||||
|
||||
add_dependencies({
|
||||
Handlebars: 'handlebars',
|
||||
templates: 'js/templates',
|
||||
emoji: 'js/emoji',
|
||||
i18n: 'i18next'
|
||||
i18n: 'i18next',
|
||||
});
|
||||
|
||||
var i18n = global.i18n;
|
||||
@@ -16,9 +16,9 @@ i18n.init({
|
||||
keySeparator: false,
|
||||
interpolation: {
|
||||
prefix: "__",
|
||||
suffix: "__"
|
||||
suffix: "__",
|
||||
},
|
||||
lng: 'en'
|
||||
lng: 'en',
|
||||
});
|
||||
|
||||
var jsdom = require("jsdom");
|
||||
@@ -43,7 +43,7 @@ function render(template_name, args) {
|
||||
'notification-settings',
|
||||
'bot-settings',
|
||||
'alert-word-settings',
|
||||
'ui-settings'
|
||||
'ui-settings',
|
||||
]);
|
||||
}());
|
||||
|
||||
@@ -78,11 +78,11 @@ function render(template_name, args) {
|
||||
id: "99",
|
||||
stream: "devel",
|
||||
subject: "testing",
|
||||
sender_full_name: "King Lear"
|
||||
sender_full_name: "King Lear",
|
||||
},
|
||||
can_edit_message: true,
|
||||
can_mute_topic: true,
|
||||
narrowed: true
|
||||
narrowed: true,
|
||||
};
|
||||
|
||||
var html = '<div style="height: 250px">';
|
||||
@@ -111,8 +111,8 @@ function render(template_name, args) {
|
||||
emoji: {
|
||||
name: "MouseFace",
|
||||
display_url: "http://emojipedia-us.s3.amazonaws.com/cache/46/7f/467fe69069c408e07517621f263ea9b5.png",
|
||||
source_url: "http://emojipedia-us.s3.amazonaws.com/cache/46/7f/467fe69069c408e07517621f263ea9b5.png"
|
||||
}
|
||||
source_url: "http://emojipedia-us.s3.amazonaws.com/cache/46/7f/467fe69069c408e07517621f263ea9b5.png",
|
||||
},
|
||||
};
|
||||
|
||||
var html = '';
|
||||
@@ -133,8 +133,8 @@ function render(template_name, args) {
|
||||
var args = {
|
||||
filter: {
|
||||
pattern: "#(?P<id>[0-9]+)",
|
||||
url_format_string: "https://trac.example.com/ticket/%(id)s"
|
||||
}
|
||||
url_format_string: "https://trac.example.com/ticket/%(id)s",
|
||||
},
|
||||
};
|
||||
|
||||
var html = '';
|
||||
@@ -166,7 +166,7 @@ function render(template_name, args) {
|
||||
|
||||
(function admin_tab() {
|
||||
var args = {
|
||||
realm_name: 'Zulip'
|
||||
realm_name: 'Zulip',
|
||||
};
|
||||
var html = render('admin_tab', args);
|
||||
var admin_features = ["admin_users_table", "admin_bots_table",
|
||||
@@ -187,8 +187,8 @@ function render(template_name, args) {
|
||||
is_active: true,
|
||||
is_active_human: true,
|
||||
email: user + '@zulip.com',
|
||||
full_name: user
|
||||
}
|
||||
full_name: user,
|
||||
},
|
||||
};
|
||||
html += render('admin_user_list', args);
|
||||
});
|
||||
@@ -213,7 +213,7 @@ function render(template_name, args) {
|
||||
var words = ['lunch', 'support'];
|
||||
_.each(words, function (word) {
|
||||
var args = {
|
||||
word: word
|
||||
word: word,
|
||||
};
|
||||
html += render('alert_word_settings_item', args);
|
||||
});
|
||||
@@ -230,7 +230,7 @@ function render(template_name, args) {
|
||||
|
||||
(function bankruptcy_modal() {
|
||||
var args = {
|
||||
unread_count: 99
|
||||
unread_count: 99,
|
||||
};
|
||||
var html = render('bankruptcy_modal', args);
|
||||
global.write_handlebars_output("bankruptcy_modal", html);
|
||||
@@ -242,8 +242,8 @@ function render(template_name, args) {
|
||||
var args = {
|
||||
method: {
|
||||
method: "Email",
|
||||
enabled: false
|
||||
}
|
||||
enabled: false,
|
||||
},
|
||||
};
|
||||
|
||||
var html = '';
|
||||
@@ -263,7 +263,7 @@ function render(template_name, args) {
|
||||
var args = {
|
||||
bookend_content: "subscribed to stream",
|
||||
trailing: true,
|
||||
subscribed: true
|
||||
subscribed: true,
|
||||
};
|
||||
var html;
|
||||
var all_html = '';
|
||||
@@ -277,7 +277,7 @@ function render(template_name, args) {
|
||||
args = {
|
||||
bookend_content: "Not subscribed to stream",
|
||||
trailing: true,
|
||||
subscribed: false
|
||||
subscribed: false,
|
||||
};
|
||||
|
||||
html = render('bookend', args);
|
||||
@@ -299,7 +299,7 @@ function render(template_name, args) {
|
||||
email: "hamlet@zulip.com",
|
||||
api_key: "123456ABCD",
|
||||
name: "Hamlet",
|
||||
avatar_url: "/hamlet/avatar/url"
|
||||
avatar_url: "/hamlet/avatar/url",
|
||||
};
|
||||
html += render('bot_avatar_row', args);
|
||||
html += '</ol>';
|
||||
@@ -315,7 +315,7 @@ function render(template_name, args) {
|
||||
(function compose_invite_users() {
|
||||
var args = {
|
||||
email: 'hamlet@zulip.com',
|
||||
name: 'Hamlet'
|
||||
name: 'Hamlet',
|
||||
};
|
||||
var html = render('compose-invite-users', args);
|
||||
global.write_handlebars_output("compose-invite-users", html);
|
||||
@@ -326,7 +326,7 @@ function render(template_name, args) {
|
||||
(function compose_all_everyone() {
|
||||
var args = {
|
||||
count: '101',
|
||||
name: 'all'
|
||||
name: 'all',
|
||||
};
|
||||
var html = render('compose_all_everyone', args);
|
||||
global.write_handlebars_output("compose_all_everyone", html);
|
||||
@@ -341,7 +341,7 @@ function render(template_name, args) {
|
||||
note: "You sent a message to a muted topic.",
|
||||
link_text: "Narrow to here",
|
||||
link_msg_id: "99",
|
||||
link_class: "compose_notification_narrow_by_subject"
|
||||
link_class: "compose_notification_narrow_by_subject",
|
||||
};
|
||||
var html = '<div id="out-of-view-notification" class="notification-alert">';
|
||||
html += render('compose_notification', args);
|
||||
@@ -360,7 +360,7 @@ function render(template_name, args) {
|
||||
|
||||
(function emoji_popover_content() {
|
||||
var args = {
|
||||
emoji_list: global.emoji.emojis_name_to_css_class
|
||||
emoji_list: global.emoji.emojis_name_to_css_class,
|
||||
};
|
||||
|
||||
var html = '<div style="height: 250px">';
|
||||
@@ -379,9 +379,9 @@ function render(template_name, args) {
|
||||
fraction_present: 0.1,
|
||||
emails: "alice@zulip.com,bob@zulip.com",
|
||||
short_name: "Alice and Bob",
|
||||
name: "Alice and Bob"
|
||||
}
|
||||
]
|
||||
name: "Alice and Bob",
|
||||
},
|
||||
],
|
||||
};
|
||||
var html = render('group_pms', args);
|
||||
global.write_handlebars_output("group_pms", html);
|
||||
@@ -394,12 +394,12 @@ function render(template_name, args) {
|
||||
var args = {
|
||||
streams: [
|
||||
{
|
||||
name: "devel"
|
||||
name: "devel",
|
||||
},
|
||||
{
|
||||
name: "social"
|
||||
}
|
||||
]
|
||||
name: "social",
|
||||
},
|
||||
],
|
||||
};
|
||||
var html = render('invite_subscription', args);
|
||||
global.write_handlebars_output("invite_subscription", html);
|
||||
@@ -417,8 +417,8 @@ function render(template_name, args) {
|
||||
is_stream: true,
|
||||
content: 'This is message one.',
|
||||
last_edit_timestr: '11:00',
|
||||
starred: true
|
||||
}
|
||||
starred: true,
|
||||
},
|
||||
};
|
||||
|
||||
var html = render('single_message', message);
|
||||
@@ -439,7 +439,7 @@ function render(template_name, args) {
|
||||
var args = {
|
||||
topic: "lunch",
|
||||
content: "Let's go to lunch!",
|
||||
is_stream: true
|
||||
is_stream: true,
|
||||
};
|
||||
var html = render('message_edit_form', args);
|
||||
global.write_handlebars_output("message_edit_form", html);
|
||||
@@ -456,11 +456,11 @@ function render(template_name, args) {
|
||||
match_content: 'This is message one.',
|
||||
starred: true,
|
||||
is_stream: true,
|
||||
content: 'This is message one.'
|
||||
content: 'This is message one.',
|
||||
},
|
||||
include_recipient: true,
|
||||
display_recipient: 'devel',
|
||||
last_edit_timestr: '11:00'
|
||||
last_edit_timestr: '11:00',
|
||||
},
|
||||
{
|
||||
msg: {
|
||||
@@ -468,9 +468,9 @@ function render(template_name, args) {
|
||||
match_content: 'This is message <span class="highlight">two</span>.',
|
||||
is_stream: true,
|
||||
unread: true,
|
||||
id: 2
|
||||
}
|
||||
}
|
||||
id: 2,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
var groups = [
|
||||
@@ -481,8 +481,8 @@ function render(template_name, args) {
|
||||
message_containers: messages,
|
||||
show_date: '"<span id="timerender82">Jan 07</span>"',
|
||||
subject: 'two messages',
|
||||
match_subject: '<span class="highlight">two</span> messages'
|
||||
}
|
||||
match_subject: '<span class="highlight">two</span> messages',
|
||||
},
|
||||
];
|
||||
|
||||
var html = render('message_group', {message_groups: groups, use_match_properties: true});
|
||||
@@ -505,10 +505,10 @@ function render(template_name, args) {
|
||||
full_date_str: 'Monday',
|
||||
full_time_str: '12:00',
|
||||
sender_full_name: 'Alice Smith',
|
||||
sender_email: 'alice@zulip.com'
|
||||
sender_email: 'alice@zulip.com',
|
||||
},
|
||||
sent_by_uri: '/sent_by/uri',
|
||||
pm_with_uri: '/pm_with/uri'
|
||||
pm_with_uri: '/pm_with/uri',
|
||||
};
|
||||
|
||||
var html = render('message_info_popover_content', args);
|
||||
@@ -523,8 +523,8 @@ function render(template_name, args) {
|
||||
var args = {
|
||||
message: {
|
||||
is_stream: true,
|
||||
stream: 'devel'
|
||||
}
|
||||
stream: 'devel',
|
||||
},
|
||||
};
|
||||
|
||||
var html = render('message_info_popover_title', args);
|
||||
@@ -539,13 +539,13 @@ function render(template_name, args) {
|
||||
users: [
|
||||
{
|
||||
email: 'lear@zulip.com',
|
||||
full_name: 'King Lear'
|
||||
full_name: 'King Lear',
|
||||
},
|
||||
{
|
||||
email: 'othello@zulip.com',
|
||||
full_name: 'Othello the Moor'
|
||||
}
|
||||
]
|
||||
full_name: 'Othello the Moor',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
var html = render('new_stream_users', args);
|
||||
@@ -559,7 +559,7 @@ function render(template_name, args) {
|
||||
var args = {
|
||||
content: "Hello",
|
||||
gravatar_url: "/gravatar/url",
|
||||
title: "You have a notification"
|
||||
title: "You have a notification",
|
||||
};
|
||||
|
||||
var html = render('notification', args);
|
||||
@@ -585,12 +585,12 @@ function render(template_name, args) {
|
||||
sounds_enabled: true, enable_offline_email_notifications: true,
|
||||
enable_offline_push_notifications: true, enable_online_push_notifications: true,
|
||||
enable_digest_emails: true,
|
||||
autoscroll_forever: true, default_desktop_notifications: true
|
||||
autoscroll_forever: true, default_desktop_notifications: true,
|
||||
};
|
||||
var page_params = $.extend(page_param_checkbox_options, {
|
||||
fullname: "Alyssa P. Hacker", password_auth_enabled: true,
|
||||
avatar_url: "https://google.com",
|
||||
domain: "zulip.com"
|
||||
domain: "zulip.com",
|
||||
});
|
||||
|
||||
var checkbox_ids = ["enable_stream_desktop_notifications",
|
||||
@@ -628,9 +628,9 @@ function render(template_name, args) {
|
||||
want_show_more_messages_links: true,
|
||||
messages: [
|
||||
{
|
||||
recipients: "alice,bob"
|
||||
}
|
||||
]
|
||||
recipients: "alice,bob",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
var html = '';
|
||||
@@ -673,8 +673,8 @@ function render(template_name, args) {
|
||||
color: 'red',
|
||||
name: 'devel',
|
||||
in_home_view: true,
|
||||
id: 55
|
||||
}
|
||||
id: 55,
|
||||
},
|
||||
};
|
||||
|
||||
var html = render('stream_sidebar_actions', args);
|
||||
@@ -690,7 +690,7 @@ function render(template_name, args) {
|
||||
color: "red",
|
||||
dark_background: "maroon",
|
||||
uri: "/devel/uri",
|
||||
id: 999
|
||||
id: 999,
|
||||
};
|
||||
|
||||
var html = '<ul id="stream_filters">';
|
||||
@@ -719,14 +719,14 @@ function render(template_name, args) {
|
||||
can_make_private: true, /* not logical, but that's ok */
|
||||
email_address: 'xxxxxxxxxxxxxxx@zulip.com',
|
||||
id: 888,
|
||||
in_home_view: true
|
||||
in_home_view: true,
|
||||
},
|
||||
{
|
||||
name: 'social',
|
||||
color: 'green',
|
||||
id: 999
|
||||
}
|
||||
]
|
||||
id: 999,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
var html = '';
|
||||
@@ -754,15 +754,15 @@ function render(template_name, args) {
|
||||
cls: 'root',
|
||||
title: 'Home',
|
||||
hash: '#',
|
||||
data: 'home'
|
||||
data: 'home',
|
||||
},
|
||||
{
|
||||
cls: 'stream',
|
||||
title: 'Devel',
|
||||
hash: '/stream/uri',
|
||||
data: 'devel'
|
||||
}
|
||||
]
|
||||
data: 'devel',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
var html = render('tab_bar', args);
|
||||
@@ -787,7 +787,7 @@ function render(template_name, args) {
|
||||
is_muted: false,
|
||||
topic_name: 'lunch',
|
||||
url: '/lunch/url',
|
||||
unread: 5
|
||||
unread: 5,
|
||||
};
|
||||
|
||||
var html = render('topic_list_item', args);
|
||||
@@ -802,7 +802,7 @@ function render(template_name, args) {
|
||||
var args = {
|
||||
stream_name: 'social',
|
||||
topic_name: 'lunch',
|
||||
can_mute_topic: true
|
||||
can_mute_topic: true,
|
||||
};
|
||||
var html = render('topic_sidebar_actions', args);
|
||||
|
||||
@@ -820,13 +820,13 @@ function render(template_name, args) {
|
||||
'tutorial_reply',
|
||||
'tutorial_stream',
|
||||
'tutorial_subject',
|
||||
'tutorial_title'
|
||||
'tutorial_title',
|
||||
];
|
||||
var html = '';
|
||||
_.each(tutorials, function (tutorial) {
|
||||
var args = {
|
||||
placement: 'left',
|
||||
title: 'Title'
|
||||
title: 'Title',
|
||||
};
|
||||
html = render(tutorial, args);
|
||||
global.write_handlebars_output(tutorial, html);
|
||||
@@ -842,16 +842,16 @@ function render(template_name, args) {
|
||||
type: "active",
|
||||
num_unread: 0,
|
||||
email: "lear@zulip.com",
|
||||
name: "King Lear"
|
||||
name: "King Lear",
|
||||
},
|
||||
{
|
||||
type_desc: "Away",
|
||||
type: "away",
|
||||
num_unread: 5,
|
||||
email: "othello@zulip.com",
|
||||
name: "Othello"
|
||||
}
|
||||
]
|
||||
name: "Othello",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
var html = '';
|
||||
@@ -868,7 +868,7 @@ function render(template_name, args) {
|
||||
(function user_sidebar_actions() {
|
||||
var args = {
|
||||
email: 'hamlet@zulip.com',
|
||||
name: 'Hamlet'
|
||||
name: 'Hamlet',
|
||||
};
|
||||
|
||||
var html = render('user_sidebar_actions', args);
|
||||
|
||||
@@ -4,7 +4,7 @@ add_dependencies({
|
||||
muting: 'js/muting',
|
||||
narrow: 'js/narrow',
|
||||
stream_data: 'js/stream_data',
|
||||
templates: 'js/templates'
|
||||
templates: 'js/templates',
|
||||
});
|
||||
|
||||
set_global('unread', {});
|
||||
@@ -23,7 +23,7 @@ global.compile_template('topic_list_item');
|
||||
var max_topics = 5;
|
||||
|
||||
var topics = [
|
||||
{subject: "coding"}
|
||||
{subject: "coding"},
|
||||
];
|
||||
global.stream_data.populate_stream_topics_for_tests({devel: topics});
|
||||
global.unread.num_unread_for_subject = function () {
|
||||
|
||||
@@ -12,13 +12,13 @@ global.stub_out_jquery();
|
||||
add_dependencies({
|
||||
muting: 'js/muting.js',
|
||||
people: 'js/people.js',
|
||||
unread: 'js/unread.js'
|
||||
unread: 'js/unread.js',
|
||||
});
|
||||
|
||||
var stream_data = require('js/stream_data.js');
|
||||
|
||||
stream_data = {
|
||||
canonicalized_name: stream_data.canonicalized_name
|
||||
canonicalized_name: stream_data.canonicalized_name,
|
||||
};
|
||||
set_global('stream_data', stream_data);
|
||||
set_global('blueslip', {});
|
||||
@@ -45,7 +45,7 @@ var zero_counts = {
|
||||
stream_count: new Dict(),
|
||||
subject_count: new Dict(),
|
||||
pm_count: new Dict(),
|
||||
unread_in_current_view: 0
|
||||
unread_in_current_view: 0,
|
||||
};
|
||||
|
||||
(function test_empty_counts_while_narrowed() {
|
||||
@@ -82,14 +82,14 @@ var zero_counts = {
|
||||
id: 15,
|
||||
type: 'stream',
|
||||
stream: 'social',
|
||||
subject: 'lunch'
|
||||
subject: 'lunch',
|
||||
};
|
||||
|
||||
var other_message = {
|
||||
id: 16,
|
||||
type: 'stream',
|
||||
stream: 'social',
|
||||
subject: 'lunch'
|
||||
subject: 'lunch',
|
||||
};
|
||||
|
||||
unread.process_loaded_messages([message, other_message]);
|
||||
@@ -98,7 +98,7 @@ var zero_counts = {
|
||||
assert.equal(count, 2);
|
||||
|
||||
var event = {
|
||||
subject: 'dinner'
|
||||
subject: 'dinner',
|
||||
};
|
||||
|
||||
unread.update_unread_topics(message, event);
|
||||
@@ -110,7 +110,7 @@ var zero_counts = {
|
||||
assert.equal(count, 1);
|
||||
|
||||
event = {
|
||||
subject: 'snack'
|
||||
subject: 'snack',
|
||||
};
|
||||
|
||||
unread.update_unread_topics(other_message, event);
|
||||
@@ -127,10 +127,10 @@ var zero_counts = {
|
||||
id: 18,
|
||||
type: 'stream',
|
||||
stream: 'social',
|
||||
subject: 'lunch'
|
||||
subject: 'lunch',
|
||||
};
|
||||
event = {
|
||||
subject: 'brunch'
|
||||
subject: 'brunch',
|
||||
};
|
||||
unread.update_unread_topics(other_message, event);
|
||||
|
||||
@@ -161,7 +161,7 @@ var zero_counts = {
|
||||
id: 15,
|
||||
type: 'stream',
|
||||
stream: 'social',
|
||||
subject: 'test_muting'
|
||||
subject: 'test_muting',
|
||||
};
|
||||
|
||||
unread.process_loaded_messages([message]);
|
||||
@@ -186,7 +186,7 @@ var zero_counts = {
|
||||
var message = {
|
||||
type: 'stream',
|
||||
stream: 'social',
|
||||
subject: 'lunch'
|
||||
subject: 'lunch',
|
||||
};
|
||||
|
||||
var num_msgs = 10000;
|
||||
@@ -224,7 +224,7 @@ var zero_counts = {
|
||||
id: 15,
|
||||
type: 'stream',
|
||||
stream: 'social',
|
||||
subject: 'lunch'
|
||||
subject: 'lunch',
|
||||
};
|
||||
|
||||
home_msg_list.get = function (msg_id) {
|
||||
@@ -261,7 +261,7 @@ var zero_counts = {
|
||||
id: 999,
|
||||
type: 'stream',
|
||||
stream: 'foo',
|
||||
subject: 'phantom'
|
||||
subject: 'phantom',
|
||||
};
|
||||
|
||||
unread.process_read_message(message);
|
||||
@@ -283,13 +283,13 @@ var zero_counts = {
|
||||
var message = {
|
||||
id: 15,
|
||||
type: 'private',
|
||||
reply_to: 'anybody@example.com'
|
||||
reply_to: 'anybody@example.com',
|
||||
};
|
||||
|
||||
var anybody = {
|
||||
email: 'anybody@example.com',
|
||||
user_id: 999,
|
||||
full_name: 'Any Body'
|
||||
full_name: 'Any Body',
|
||||
};
|
||||
people.add_in_realm(anybody);
|
||||
|
||||
@@ -308,14 +308,14 @@ var zero_counts = {
|
||||
var alice = {
|
||||
email: 'alice@example.com',
|
||||
user_id: 101,
|
||||
full_name: 'Alice'
|
||||
full_name: 'Alice',
|
||||
};
|
||||
people.add_in_realm(alice);
|
||||
|
||||
var bob = {
|
||||
email: 'bob@example.com',
|
||||
user_id: 102,
|
||||
full_name: 'Bob'
|
||||
full_name: 'Bob',
|
||||
};
|
||||
people.add_in_realm(bob);
|
||||
|
||||
@@ -325,11 +325,11 @@ var zero_counts = {
|
||||
var message = {
|
||||
id: 15,
|
||||
reply_to: 'alice@example.com',
|
||||
type: 'private'
|
||||
type: 'private',
|
||||
};
|
||||
|
||||
var read_message = {
|
||||
flags: ['read']
|
||||
flags: ['read'],
|
||||
};
|
||||
unread.process_loaded_messages([message, read_message]);
|
||||
assert.equal(unread.num_unread_for_person(alice.user_id), 1);
|
||||
@@ -352,7 +352,7 @@ var zero_counts = {
|
||||
type: 'stream',
|
||||
stream: 'social',
|
||||
subject: 'lunch',
|
||||
mentioned: true
|
||||
mentioned: true,
|
||||
};
|
||||
|
||||
unread.process_loaded_messages([message]);
|
||||
@@ -376,7 +376,7 @@ var zero_counts = {
|
||||
assert.equal(count, 0);
|
||||
|
||||
var message = {
|
||||
id: 15
|
||||
id: 15,
|
||||
};
|
||||
current_msg_list.all_messages = function () {
|
||||
return [message];
|
||||
@@ -410,7 +410,7 @@ var zero_counts = {
|
||||
var message = {
|
||||
id: 9,
|
||||
type: 'private',
|
||||
reply_to: 'unknown@zulip.com'
|
||||
reply_to: 'unknown@zulip.com',
|
||||
};
|
||||
|
||||
unread.process_read_message(message);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
global.stub_out_jquery();
|
||||
|
||||
add_dependencies({
|
||||
util: 'js/util.js'
|
||||
util: 'js/util.js',
|
||||
});
|
||||
|
||||
var util = global.util;
|
||||
@@ -13,7 +13,7 @@ var _ = global._;
|
||||
var cv = new util.CachedValue({
|
||||
compute_value: function () {
|
||||
return x * 2;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
assert.equal(cv.get(), 10);
|
||||
@@ -55,39 +55,32 @@ var _ = global._;
|
||||
_.each([util.same_recipient, util.same_major_recipient], function (same) {
|
||||
assert(same(
|
||||
{type: 'stream', stream: 'Foo', subject: 'Bar'},
|
||||
{type: 'stream', stream: 'fOO', subject: 'bar'}
|
||||
));
|
||||
{type: 'stream', stream: 'fOO', subject: 'bar'}));
|
||||
|
||||
assert(!same(
|
||||
{type: 'stream', stream: 'Foo', subject: 'Bar'},
|
||||
{type: 'stream', stream: 'yo', subject: 'whatever'}
|
||||
));
|
||||
{type: 'stream', stream: 'yo', subject: 'whatever'}));
|
||||
|
||||
assert(same(
|
||||
{type: 'private', reply_to: 'fred@zulip.com,melissa@zulip.com'},
|
||||
{type: 'private', reply_to: 'fred@zulip.com,melissa@zulip.com'}
|
||||
));
|
||||
{type: 'private', reply_to: 'fred@zulip.com,melissa@zulip.com'}));
|
||||
|
||||
assert(same(
|
||||
{type: 'private', reply_to: 'fred@zulip.com'},
|
||||
{type: 'private', reply_to: 'Fred@zulip.com'}
|
||||
));
|
||||
{type: 'private', reply_to: 'Fred@zulip.com'}));
|
||||
|
||||
assert(!same(
|
||||
{type: 'stream', stream: 'Foo', subject: 'Bar'},
|
||||
{type: 'private', reply_to: 'Fred@zulip.com'}
|
||||
));
|
||||
{type: 'private', reply_to: 'Fred@zulip.com'}));
|
||||
});
|
||||
|
||||
assert(util.same_major_recipient(
|
||||
{type: 'stream', stream: 'Foo', subject: 'sub1'},
|
||||
{type: 'stream', stream: 'fOO', subject: 'sub2'}
|
||||
));
|
||||
{type: 'stream', stream: 'fOO', subject: 'sub2'}));
|
||||
|
||||
assert(!util.same_recipient(
|
||||
{type: 'stream', stream: 'Foo', subject: 'sub1'},
|
||||
{type: 'stream', stream: 'fOO', subject: 'sub2'}
|
||||
));
|
||||
{type: 'stream', stream: 'fOO', subject: 'sub2'}));
|
||||
|
||||
}());
|
||||
|
||||
@@ -108,8 +101,7 @@ var _ = global._;
|
||||
(function test_normalize_recipients() {
|
||||
assert.equal(
|
||||
util.normalize_recipients('ZOE@foo.com, bob@foo.com, alice@foo.com, AARON@foo.com '),
|
||||
'aaron@foo.com,alice@foo.com,bob@foo.com,zoe@foo.com'
|
||||
);
|
||||
'aaron@foo.com,alice@foo.com,bob@foo.com,zoe@foo.com');
|
||||
}());
|
||||
|
||||
(function test_random_int() {
|
||||
@@ -160,7 +152,7 @@ var _ = global._;
|
||||
'@**all**',
|
||||
'some text before @**all** some text after',
|
||||
'@**all** some text after only',
|
||||
'some text before only @**all**'
|
||||
'some text before only @**all**',
|
||||
];
|
||||
|
||||
var messages_with_everyone_mentions = [
|
||||
@@ -171,21 +163,21 @@ var _ = global._;
|
||||
'@**everyone**',
|
||||
'some text before @**everyone** some text after',
|
||||
'@**everyone** some text after only',
|
||||
'some text before only @**everyone**'
|
||||
'some text before only @**everyone**',
|
||||
];
|
||||
|
||||
var messages_without_all_mentions = [
|
||||
'`@everyone`',
|
||||
'some_email@everyone.com',
|
||||
'`@**everyone**`',
|
||||
'some_email@**everyone**.com'
|
||||
'some_email@**everyone**.com',
|
||||
];
|
||||
|
||||
var messages_without_everyone_mentions = [
|
||||
'`@everyone`',
|
||||
'some_email@everyone.com',
|
||||
'`@**everyone**`',
|
||||
'some_email@**everyone**.com'
|
||||
'some_email@**everyone**.com',
|
||||
];
|
||||
var i;
|
||||
for (i=0; i<messages_with_all_mentions.length; i += 1) {
|
||||
|
||||
Reference in New Issue
Block a user