mirror of https://github.com/zulip/zulip.git
minor: Clean up blank lines in tests.
This commit is contained in:
parent
b248b2681c
commit
2788ebdde7
|
@ -15,7 +15,6 @@ people.add({
|
|||
|
||||
people.initialize_current_user(42);
|
||||
|
||||
|
||||
const regular_message = {
|
||||
sender_email: 'another@zulip.com',
|
||||
content: '<p>a message</p>',
|
||||
|
|
|
@ -69,7 +69,6 @@ function make_people() {
|
|||
people.initialize_current_user(me.user_id);
|
||||
}
|
||||
|
||||
|
||||
function activate_people() {
|
||||
presence.presence_info.clear();
|
||||
|
||||
|
@ -94,7 +93,6 @@ function activate_people() {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
make_people();
|
||||
activate_people();
|
||||
|
||||
|
@ -209,7 +207,6 @@ run_test('bulk_data_hacks', () => {
|
|||
user_ids = buddy_data.get_filtered_and_sorted_user_ids('p');
|
||||
assert.equal(user_ids.length, 998);
|
||||
|
||||
|
||||
// Make our shrink limit higher, and go back to an empty search.
|
||||
// We won't get all 1000 users, just the present ones.
|
||||
buddy_data.max_size_before_shrinking = 50000;
|
||||
|
|
|
@ -5,7 +5,6 @@ set_global('reload', {});
|
|||
zrequire('reload_state');
|
||||
zrequire('channel');
|
||||
|
||||
|
||||
const default_stub_xhr = 'default-stub-xhr';
|
||||
|
||||
function test_with_mock_ajax(test_params) {
|
||||
|
@ -38,7 +37,6 @@ function test_with_mock_ajax(test_params) {
|
|||
check_ajax_options(ajax_options);
|
||||
}
|
||||
|
||||
|
||||
run_test('basics', () => {
|
||||
test_with_mock_ajax({
|
||||
run_code: function () {
|
||||
|
|
|
@ -179,7 +179,6 @@ run_test('validate', () => {
|
|||
$("#sending-indicator").hide();
|
||||
$("#compose-textarea").select(noop);
|
||||
|
||||
|
||||
const pm_pill_container = $.create('fake-pm-pill-container');
|
||||
$('#private_message_recipient').set_parent(pm_pill_container);
|
||||
pm_pill_container.set_find_results('.input', $('#private_message_recipient'));
|
||||
|
@ -880,7 +879,6 @@ run_test('warn_if_private_stream_is_linked', () => {
|
|||
for (const f of checks) { f(); }
|
||||
});
|
||||
|
||||
|
||||
run_test('initialize', () => {
|
||||
// In this test we mostly do the setup stuff in addition to testing the
|
||||
// normal workflow of the function. All the tests for the on functions are
|
||||
|
@ -1105,7 +1103,6 @@ run_test('warn_if_mentioning_unsubscribed_user', () => {
|
|||
return function () { assert(called); };
|
||||
}()),
|
||||
|
||||
|
||||
(function () {
|
||||
let called;
|
||||
global.stub_templates(function (template_name, context) {
|
||||
|
@ -1138,7 +1135,6 @@ run_test('warn_if_mentioning_unsubscribed_user', () => {
|
|||
|
||||
for (const f of checks) { f(); }
|
||||
|
||||
|
||||
// Simulate that the row was added to the DOM.
|
||||
const warning_row = $('<warning row>');
|
||||
|
||||
|
@ -1620,7 +1616,6 @@ run_test('create_message_object', () => {
|
|||
return s;
|
||||
};
|
||||
|
||||
|
||||
let message = compose.create_message_object();
|
||||
assert.equal(message.to, sub.stream_id);
|
||||
assert.equal(message.topic, 'lunch');
|
||||
|
|
|
@ -13,7 +13,6 @@ set_global('$', global.make_zjquery());
|
|||
set_global('compose_pm_pill', {
|
||||
});
|
||||
|
||||
|
||||
set_global('hash_util', {
|
||||
});
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ people.initialize_current_user(me.user_id);
|
|||
people.add(alice);
|
||||
people.add(bob);
|
||||
|
||||
|
||||
run_test('set_focused_recipient', () => {
|
||||
const sub = {
|
||||
stream_id: 101,
|
||||
|
|
|
@ -352,8 +352,6 @@ run_test('content_typeahead_selected', () => {
|
|||
expected_value = '{ :octopus: ';
|
||||
assert.equal(actual_value, expected_value);
|
||||
|
||||
|
||||
|
||||
// mention
|
||||
fake_this.completing = 'mention';
|
||||
|
||||
|
@ -992,7 +990,6 @@ run_test('initialize', () => {
|
|||
event.target.id = 'some_non_existing_id';
|
||||
$('form#send_message_form').keydown(event);
|
||||
|
||||
|
||||
// Setup jquery functions used in compose_textarea enter
|
||||
// handler.
|
||||
let range_length = 0;
|
||||
|
@ -1254,7 +1251,6 @@ run_test('begins_typeahead', () => {
|
|||
assert_typeahead_equals("hello /poll", false);
|
||||
assert_typeahead_equals("\n/pol", false);
|
||||
|
||||
|
||||
assert_typeahead_equals("x/", false);
|
||||
assert_typeahead_equals("```", false);
|
||||
assert_typeahead_equals("``` ", false);
|
||||
|
|
|
@ -1284,7 +1284,6 @@ run_test('update_email', () => {
|
|||
assert.deepEqual(filter.operands('stream'), ['steve@foo.com']);
|
||||
});
|
||||
|
||||
|
||||
run_test('error_cases', () => {
|
||||
// This test just gives us 100% line coverage on defensive code that
|
||||
// should not be reached unless we break other code.
|
||||
|
|
|
@ -451,7 +451,6 @@ run_test('insert_message', () => {
|
|||
assert.equal(inserted_message.content, 'example content');
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
|
||||
The previous example starts to get us out of the data layer of
|
||||
|
@ -710,7 +709,6 @@ run_test('stream_list', () => {
|
|||
const sidebar_helper = make_sidebar_helper();
|
||||
const topic_list_helper = make_topic_list_helper();
|
||||
|
||||
|
||||
// This is what we are testing!
|
||||
stream_list.update_streams_sidebar();
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@ run_test('set_up_ids', () => {
|
|||
};
|
||||
});
|
||||
|
||||
|
||||
function pill_html(value, data_id, img_src) {
|
||||
const has_image = img_src !== undefined;
|
||||
|
||||
|
|
|
@ -272,7 +272,6 @@ run_test('initialize', () => {
|
|||
test_backfill_idle(idle_config);
|
||||
});
|
||||
|
||||
|
||||
function simulate_narrow() {
|
||||
const filter = {
|
||||
predicate: () => () => false,
|
||||
|
|
|
@ -15,7 +15,6 @@ zrequire('MessageListData', 'js/message_list_data');
|
|||
zrequire('MessageListView', 'js/message_list_view');
|
||||
const MessageList = zrequire('message_list').MessageList;
|
||||
|
||||
|
||||
const with_overrides = global.with_overrides; // make lint happy
|
||||
|
||||
function accept_all_filter() {
|
||||
|
@ -287,7 +286,6 @@ run_test('local_echo', () => {
|
|||
assert.equal(list.closest_id(54), 50);
|
||||
assert.equal(list.closest_id(58), 60);
|
||||
|
||||
|
||||
list = new MessageList({});
|
||||
list.append([
|
||||
{id: 10}, {id: 20}, {id: 30}, {id: 20.02}, {id: 20.03}, {id: 40},
|
||||
|
|
|
@ -75,7 +75,6 @@ run_test('basics', () => {
|
|||
mld.get(10).unread = false;
|
||||
assert.equal(mld.first_unread_message_id(), 15);
|
||||
|
||||
|
||||
mld.clear();
|
||||
assert_contents(mld, []);
|
||||
assert.equal(mld.closest_id(99), -1);
|
||||
|
|
|
@ -362,7 +362,6 @@ run_test('merge_message_groups', () => {
|
|||
assert_message_list_equal(result.rerender_messages_next_same_sender, [message1]);
|
||||
}());
|
||||
|
||||
|
||||
(function test_prepend_message_same_subject() {
|
||||
|
||||
const message1 = build_message_context();
|
||||
|
@ -556,7 +555,6 @@ run_test('render_windows', () => {
|
|||
list.add_messages(messages, {});
|
||||
}
|
||||
|
||||
|
||||
function verify_no_move_range(start, end) {
|
||||
// In our render window, there are up to 300 positions in
|
||||
// the list where we can move the pointer without forcing
|
||||
|
|
|
@ -80,7 +80,6 @@ run_test('get_and_set_muted_topics', () => {
|
|||
|
||||
blueslip.clear_test_data();
|
||||
|
||||
|
||||
assert.deepEqual(muting.get_muted_topics().sort(), [
|
||||
[design.stream_id, 'typography'],
|
||||
[social.stream_id, 'breakfast'],
|
||||
|
|
|
@ -38,7 +38,6 @@ set_global('search_pill_widget', {
|
|||
},
|
||||
});
|
||||
|
||||
|
||||
const noop = () => {};
|
||||
//
|
||||
// We have strange hacks in narrow.activate to sleep 0
|
||||
|
|
|
@ -15,7 +15,6 @@ function set_filter(operators) {
|
|||
narrow_state.set_current_filter(new Filter(operators));
|
||||
}
|
||||
|
||||
|
||||
run_test('stream', () => {
|
||||
assert.equal(narrow_state.public_operators(), undefined);
|
||||
assert(!narrow_state.active());
|
||||
|
@ -48,7 +47,6 @@ run_test('stream', () => {
|
|||
assert.equal(narrow_state.search_string(), 'stream:Test topic:Bar yo');
|
||||
});
|
||||
|
||||
|
||||
run_test('narrowed', () => {
|
||||
narrow_state.reset_current_filter(); // not narrowed, basically
|
||||
assert(!narrow_state.narrowed_to_pms());
|
||||
|
@ -223,7 +221,6 @@ run_test('topic', () => {
|
|||
assert.equal(narrow_state.topic(), undefined);
|
||||
});
|
||||
|
||||
|
||||
run_test('stream', () => {
|
||||
set_filter([]);
|
||||
assert.equal(narrow_state.stream(), undefined);
|
||||
|
|
|
@ -20,7 +20,6 @@ const _navigator = {
|
|||
};
|
||||
set_global('navigator', _navigator);
|
||||
|
||||
|
||||
zrequire('alert_words');
|
||||
zrequire('muting');
|
||||
zrequire('stream_data');
|
||||
|
@ -249,7 +248,6 @@ run_test('message_is_notifiable', () => {
|
|||
assert.equal(notifications.message_is_notifiable(message), true);
|
||||
});
|
||||
|
||||
|
||||
run_test('basic_notifications', () => {
|
||||
|
||||
let n; // Object for storing all notification data for assertions.
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
set_global('zxcvbn', zrequire('zxcvbn', 'zxcvbn'));
|
||||
zrequire('common');
|
||||
|
||||
|
||||
run_test('basics', () => {
|
||||
let accepted;
|
||||
let password;
|
||||
|
|
|
@ -24,7 +24,6 @@ set_global('page_params', {
|
|||
});
|
||||
set_global('rows', {});
|
||||
|
||||
|
||||
set_global('message_viewport', {
|
||||
height: () => 500,
|
||||
});
|
||||
|
|
|
@ -404,7 +404,6 @@ run_test('add_and_remove_reaction', () => {
|
|||
current_emojis = reactions.get_emojis_used_by_user_for_message_id(1001);
|
||||
assert.deepEqual(current_emojis, ['smile', 'inactive_realm_emoji']);
|
||||
|
||||
|
||||
// Now add Cali's realm_emoji reaction.
|
||||
const cali_event = {
|
||||
message_id: 1001,
|
||||
|
|
|
@ -216,7 +216,6 @@ run_test('initizalize', () => {
|
|||
};
|
||||
};
|
||||
|
||||
|
||||
operators = [];
|
||||
_setup('');
|
||||
|
||||
|
@ -252,7 +251,6 @@ run_test('initizalize', () => {
|
|||
assert(!is_blurred);
|
||||
assert(!search_button.prop('disabled'));
|
||||
|
||||
|
||||
_setup('ver');
|
||||
ev.which = 13;
|
||||
search_query_box.is = return_true;
|
||||
|
|
|
@ -188,7 +188,6 @@ run_test('initialize', () => {
|
|||
};
|
||||
};
|
||||
|
||||
|
||||
operators = [{
|
||||
negated: false,
|
||||
operator: 'search',
|
||||
|
@ -216,7 +215,6 @@ run_test('initialize', () => {
|
|||
assert(is_blurred);
|
||||
assert(search_button.prop('disabled'));
|
||||
|
||||
|
||||
_setup('ver');
|
||||
search.is_using_input_method = true;
|
||||
func(ev);
|
||||
|
@ -224,7 +222,6 @@ run_test('initialize', () => {
|
|||
assert(!is_blurred);
|
||||
assert(!search_button.prop('disabled'));
|
||||
|
||||
|
||||
_setup('ver');
|
||||
ev.which = 13;
|
||||
search_query_box.is = return_true;
|
||||
|
|
|
@ -6,7 +6,6 @@ set_global('message_store', {
|
|||
user_ids: () => [],
|
||||
});
|
||||
|
||||
|
||||
const settings_config = zrequire('settings_config');
|
||||
page_params.realm_email_address_visibility =
|
||||
settings_config.email_address_visibility_values.admins_only.code;
|
||||
|
@ -199,7 +198,6 @@ run_test('private_suggestions', () => {
|
|||
];
|
||||
assert.deepEqual(suggestions.strings, expected);
|
||||
|
||||
|
||||
// Users can enter bizarre queries, and if they do, we want to
|
||||
// be conservative with suggestions.
|
||||
query = 'near:3';
|
||||
|
|
|
@ -5,7 +5,6 @@ set_global('message_store', {
|
|||
user_ids: () => [],
|
||||
});
|
||||
|
||||
|
||||
const settings_config = zrequire('settings_config');
|
||||
page_params.realm_email_address_visibility =
|
||||
settings_config.email_address_visibility_values.admins_only.code;
|
||||
|
@ -29,7 +28,6 @@ const bob = {
|
|||
user_id: 42,
|
||||
};
|
||||
|
||||
|
||||
function init() {
|
||||
people.init();
|
||||
people.add(bob);
|
||||
|
@ -195,7 +193,6 @@ run_test('private_suggestions', () => {
|
|||
];
|
||||
assert.deepEqual(suggestions.strings, expected);
|
||||
|
||||
|
||||
// Users can enter bizarre queries, and if they do, we want to
|
||||
// be conservative with suggestions.
|
||||
query = 'is:private near:3';
|
||||
|
@ -985,7 +982,6 @@ run_test('people_suggestions', () => {
|
|||
people.add(bob);
|
||||
people.add(alice);
|
||||
|
||||
|
||||
topic_data.reset();
|
||||
|
||||
let suggestions = search.get_suggestions_legacy(query);
|
||||
|
|
|
@ -34,7 +34,6 @@ set_global('ui_report', {
|
|||
show_error: function () { return false; },
|
||||
});
|
||||
|
||||
|
||||
server_events.home_view_loaded();
|
||||
|
||||
run_test('message_event', () => {
|
||||
|
@ -77,7 +76,6 @@ run_test('pointer_event', () => {
|
|||
assert.equal(global.pointer.server_furthest_read, event.pointer);
|
||||
});
|
||||
|
||||
|
||||
// Start blueslip tests here
|
||||
|
||||
const setup = function () {
|
||||
|
@ -118,7 +116,6 @@ run_test('event_dispatch_error', () => {
|
|||
blueslip.clear_test_data();
|
||||
});
|
||||
|
||||
|
||||
run_test('event_new_message_error', () => {
|
||||
setup();
|
||||
|
||||
|
|
|
@ -285,7 +285,6 @@ function test_submit_settings_form(submit_form) {
|
|||
};
|
||||
assert.deepEqual(data, expected_value);
|
||||
|
||||
|
||||
subsection = 'user-defaults';
|
||||
ev.currentTarget = `#org-submit-${subsection}`;
|
||||
stubs = createSaveButtons(subsection);
|
||||
|
@ -321,7 +320,6 @@ function test_submit_settings_form(submit_form) {
|
|||
};
|
||||
assert.deepEqual(data, expected_value);
|
||||
|
||||
|
||||
// Testing only once for since callback is same for all cases
|
||||
success_callback();
|
||||
assert.equal(stubs.props.hidden, true);
|
||||
|
@ -423,7 +421,6 @@ function test_change_allow_subdomains(change_allow_subdomains) {
|
|||
const domain_obj = $.create('domain object');
|
||||
domain_obj.text(domain);
|
||||
|
||||
|
||||
const elem_obj = $.create('<elem html>');
|
||||
const parents_obj = $.create('parents object');
|
||||
|
||||
|
@ -709,7 +706,6 @@ function test_discard_changes_button(discard_changes) {
|
|||
message_content_edit_limit_minutes.attr('id', 'id_realm_message_content_edit_limit_minutes');
|
||||
message_content_delete_limit_minutes.attr('id', 'id_realm_message_content_delete_limit_minutes');
|
||||
|
||||
|
||||
const discard_button_parent = $('.org-subsection-parent');
|
||||
discard_button_parent.find = () => [
|
||||
allow_edit_history,
|
||||
|
|
|
@ -3,7 +3,6 @@ set_global('$', global.make_zjquery());
|
|||
set_global('loading', {});
|
||||
set_global('Sortable', {create: () => {}});
|
||||
|
||||
|
||||
const SHORT_TEXT_ID = 1;
|
||||
const CHOICE_ID = 3;
|
||||
const EXTERNAL_ACCOUNT_ID = 7;
|
||||
|
|
|
@ -459,7 +459,6 @@ run_test('sort_streams', () => {
|
|||
return sub.name !== 'cars';
|
||||
};
|
||||
|
||||
|
||||
let appended_elems;
|
||||
$('#stream_filters').append = function (elems) {
|
||||
appended_elems = elems;
|
||||
|
@ -592,7 +591,6 @@ run_test('separators_only_pinned', () => {
|
|||
};
|
||||
add_row(RomeSub);
|
||||
|
||||
|
||||
let appended_elems;
|
||||
$('#stream_filters').append = function (elems) {
|
||||
appended_elems = elems;
|
||||
|
|
|
@ -123,7 +123,6 @@ run_test('update_count_in_dom', () => {
|
|||
'<starred-value>'
|
||||
);
|
||||
|
||||
|
||||
top_left_corner.update_dom_with_unread_counts(counts);
|
||||
top_left_corner.update_starred_count(444);
|
||||
|
||||
|
|
|
@ -86,7 +86,6 @@ run_test('is_complete_for_stream_id', () => {
|
|||
topic_data.is_complete_for_stream_id(sub.stream_id),
|
||||
true);
|
||||
|
||||
|
||||
// Now simulate a more recent message id.
|
||||
message_list.all.first = () => {
|
||||
return {id: sub.first_message_id + 1};
|
||||
|
|
|
@ -251,7 +251,6 @@ run_test('topics', () => {
|
|||
assert.deepEqual(next_topic(undefined, undefined),
|
||||
{stream: 1, topic: '1a'});
|
||||
|
||||
|
||||
// Now test the deeper function that is wired up to
|
||||
// real functions stream_data/stream_sort/unread.
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@ const settings_config = zrequire('settings_config');
|
|||
page_params.realm_email_address_visibility =
|
||||
settings_config.email_address_visibility_values.admins_only.code;
|
||||
|
||||
|
||||
set_global('Handlebars', global.make_handlebars());
|
||||
zrequire('recent_senders');
|
||||
zrequire('pm_conversations');
|
||||
|
|
|
@ -45,7 +45,6 @@ run_test('basics', () => {
|
|||
assert.deepEqual(typing_data.get_group_typists([20, 40]), [20]);
|
||||
});
|
||||
|
||||
|
||||
run_test('timers', () => {
|
||||
const events = {};
|
||||
|
||||
|
|
|
@ -68,7 +68,6 @@ for (const mod of ignore_modules) {
|
|||
|
||||
emoji.emojis_by_name = new Map();
|
||||
|
||||
|
||||
util.is_mobile = () => false;
|
||||
global.stub_templates(() => 'some-html');
|
||||
ui.get_scroll_element = element => element;
|
||||
|
@ -181,7 +180,6 @@ $("#private_message_recipient").typeahead = () => {};
|
|||
$("#compose-textarea").typeahead = () => {};
|
||||
$("#search_query").typeahead = () => {};
|
||||
|
||||
|
||||
const value_stub = $.create('value');
|
||||
const count_stub = $.create('count');
|
||||
count_stub.set_find_results('.value', value_stub);
|
||||
|
|
|
@ -322,7 +322,6 @@ run_test('num_unread_for_topic', () => {
|
|||
assert.deepEqual(msg_ids, []);
|
||||
});
|
||||
|
||||
|
||||
run_test('home_messages', () => {
|
||||
stream_data.is_subscribed = function () {
|
||||
return true;
|
||||
|
@ -481,7 +480,6 @@ run_test('private_messages', () => {
|
|||
test_notifiable_count(counts.home_unread_messages, 0);
|
||||
});
|
||||
|
||||
|
||||
run_test('mentions', () => {
|
||||
let counts = unread.get_counts();
|
||||
assert.equal(counts.mentioned_message_count, 0);
|
||||
|
|
|
@ -381,7 +381,6 @@ run_test('uppy_events', () => {
|
|||
let uppy_cancel_all_counter = 0;
|
||||
let state = {};
|
||||
|
||||
|
||||
function uppy_stub() {
|
||||
return {
|
||||
setMeta: () => {},
|
||||
|
|
|
@ -6,7 +6,6 @@ set_global('blueslip', global.make_zblueslip());
|
|||
set_global('document', {});
|
||||
const util = zrequire('util');
|
||||
|
||||
|
||||
run_test('CachedValue', () => {
|
||||
let x = 5;
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ set_global('blueslip', global.make_zblueslip());
|
|||
set_global('narrow_state', {});
|
||||
set_global('current_msg_list', {});
|
||||
|
||||
|
||||
run_test('activate', () => {
|
||||
// Both widgetize.activate and widgetize.handle_event are tested
|
||||
// here to use the "caching" of widgets
|
||||
|
|
|
@ -19,7 +19,6 @@ Read the following contents for an overview of how zblueslip works. Also take a
|
|||
look at `node_tests/people_errors.js` for actual usage of this module.
|
||||
*/
|
||||
|
||||
|
||||
// The first thing we do to use zblueslip is patch our global namespace
|
||||
// with zblueslip as follows. This call gives us our own instance of a
|
||||
// zblueslip stub variable.
|
||||
|
|
|
@ -22,14 +22,12 @@ The code we are testing lives here:
|
|||
|
||||
*/
|
||||
|
||||
|
||||
// The first thing we do to use zjquery is patch our global namespace
|
||||
// with zjquery as follows. This call gives us our own instance of a
|
||||
// zjquery stub variable. Like with real jQuery, the '$' function will
|
||||
// be the gateway to a bigger API.
|
||||
set_global('$', global.make_zjquery());
|
||||
|
||||
|
||||
run_test('basics', () => {
|
||||
// Let's create a sample piece of code to test:
|
||||
|
||||
|
|
Loading…
Reference in New Issue