mirror of https://github.com/zulip/zulip.git
lint: Fix comma spacing in node tests.
I apparently failed to check the tests codebase before merging the last linter commit. Oops.
This commit is contained in:
parent
838dd6d273
commit
b2939cdf19
|
@ -114,7 +114,7 @@ casper.then(function () {
|
|||
casper.then(function create_bot() {
|
||||
casper.test.info('Filling out the create bot form for an outgoing webhook bot');
|
||||
|
||||
casper.fill('#create_bot_form',{
|
||||
casper.fill('#create_bot_form', {
|
||||
bot_name: 'Bot 1',
|
||||
bot_short_name: '1',
|
||||
bot_type: OUTGOING_WEBHOOK_BOT_TYPE,
|
||||
|
@ -146,7 +146,7 @@ casper.then(function () {
|
|||
casper.then(function create_bot() {
|
||||
casper.test.info('Filling out the create bot form for a normal bot');
|
||||
|
||||
casper.fill('#create_bot_form',{
|
||||
casper.fill('#create_bot_form', {
|
||||
bot_name: 'Bot 2',
|
||||
bot_short_name: '2',
|
||||
bot_type: GENERIC_BOT_TYPE,
|
||||
|
|
|
@ -137,7 +137,7 @@ run_test('test_basics', () => {
|
|||
(function test_get_editable() {
|
||||
let can_admin;
|
||||
|
||||
bot_data.add({...test_bot ,user_id: 44, owner: 'owner@zulip.com', is_active: true});
|
||||
bot_data.add({...test_bot, user_id: 44, owner: 'owner@zulip.com', is_active: true});
|
||||
bot_data.add({...test_bot, user_id: 45, email: 'bot2@zulip.com', owner: 'owner@zulip.com', is_active: true});
|
||||
bot_data.add({...test_bot, user_id: 46, email: 'bot3@zulip.com', owner: 'not_owner@zulip.com', is_active: true});
|
||||
|
||||
|
|
|
@ -1245,8 +1245,8 @@ run_test('typeahead_results', () => {
|
|||
assert.deepEqual(returned, expected);
|
||||
}
|
||||
|
||||
assert_emoji_matches('da',[{emoji_name: "tada", emoji_url: "TBD", codepoint: "1f389"},
|
||||
{emoji_name: "panda_face", emoji_url: "TBD", codepoint: "1f43c"}]);
|
||||
assert_emoji_matches('da', [{emoji_name: "tada", emoji_url: "TBD", codepoint: "1f389"},
|
||||
{emoji_name: "panda_face", emoji_url: "TBD", codepoint: "1f43c"}]);
|
||||
assert_emoji_matches('da_', []);
|
||||
assert_emoji_matches('da ', []);
|
||||
assert_emoji_matches('panda ', [{emoji_name: "panda_face", emoji_url: "TBD", codepoint: "1f43c"}]);
|
||||
|
|
|
@ -13,7 +13,7 @@ set_global('alert_words', {
|
|||
process_message: noop,
|
||||
});
|
||||
|
||||
set_global('topic_data' , {
|
||||
set_global('topic_data', {
|
||||
add_message: noop,
|
||||
});
|
||||
|
||||
|
|
|
@ -105,77 +105,77 @@ run_test('show_empty_narrow_message', () => {
|
|||
|
||||
narrow_state.reset_current_filter();
|
||||
narrow.show_empty_narrow_message();
|
||||
assert.equal(hide_id,'.empty_feed_notice');
|
||||
assert.equal(hide_id, '.empty_feed_notice');
|
||||
assert.equal(show_id, '#empty_narrow_message');
|
||||
assert.equal(attr_id, '#left_bar_compose_reply_button_big');
|
||||
|
||||
// for non-existent or private stream
|
||||
set_filter([['stream', 'Foo']]);
|
||||
narrow.show_empty_narrow_message();
|
||||
assert.equal(hide_id,'.empty_feed_notice');
|
||||
assert.equal(hide_id, '.empty_feed_notice');
|
||||
assert.equal(show_id, '#nonsubbed_private_nonexistent_stream_narrow_message');
|
||||
|
||||
// for non sub public stream
|
||||
stream_data.add_sub('ROME', {name: 'ROME', stream_id: 99});
|
||||
set_filter([['stream', 'Rome']]);
|
||||
narrow.show_empty_narrow_message();
|
||||
assert.equal(hide_id,'.empty_feed_notice');
|
||||
assert.equal(hide_id, '.empty_feed_notice');
|
||||
assert.equal(show_id, '#nonsubbed_stream_narrow_message');
|
||||
|
||||
set_filter([['is', 'starred']]);
|
||||
narrow.show_empty_narrow_message();
|
||||
assert.equal(hide_id,'.empty_feed_notice');
|
||||
assert.equal(hide_id, '.empty_feed_notice');
|
||||
assert.equal(show_id, '#empty_star_narrow_message');
|
||||
|
||||
set_filter([['is', 'mentioned']]);
|
||||
narrow.show_empty_narrow_message();
|
||||
assert.equal(hide_id,'.empty_feed_notice');
|
||||
assert.equal(hide_id, '.empty_feed_notice');
|
||||
assert.equal(show_id, '#empty_narrow_all_mentioned');
|
||||
|
||||
set_filter([['is', 'private']]);
|
||||
narrow.show_empty_narrow_message();
|
||||
assert.equal(hide_id,'.empty_feed_notice');
|
||||
assert.equal(hide_id, '.empty_feed_notice');
|
||||
assert.equal(show_id, '#empty_narrow_all_private_message');
|
||||
|
||||
set_filter([['is', 'unread']]);
|
||||
narrow.show_empty_narrow_message();
|
||||
assert.equal(hide_id,'.empty_feed_notice');
|
||||
assert.equal(hide_id, '.empty_feed_notice');
|
||||
assert.equal(show_id, '#no_unread_narrow_message');
|
||||
|
||||
set_filter([['pm-with', ['Yo']]]);
|
||||
narrow.show_empty_narrow_message();
|
||||
assert.equal(hide_id,'.empty_feed_notice');
|
||||
assert.equal(hide_id, '.empty_feed_notice');
|
||||
assert.equal(show_id, '#non_existing_user');
|
||||
|
||||
people.add_in_realm(alice);
|
||||
set_filter([['pm-with', ['alice@example.com', 'Yo']]]);
|
||||
narrow.show_empty_narrow_message();
|
||||
assert.equal(hide_id,'.empty_feed_notice');
|
||||
assert.equal(hide_id, '.empty_feed_notice');
|
||||
assert.equal(show_id, '#non_existing_users');
|
||||
|
||||
set_filter([['pm-with', 'alice@example.com']]);
|
||||
narrow.show_empty_narrow_message();
|
||||
assert.equal(hide_id,'.empty_feed_notice');
|
||||
assert.equal(hide_id, '.empty_feed_notice');
|
||||
assert.equal(show_id, '#empty_narrow_private_message');
|
||||
|
||||
set_filter([['group-pm-with', 'alice@example.com']]);
|
||||
narrow.show_empty_narrow_message();
|
||||
assert.equal(hide_id,'.empty_feed_notice');
|
||||
assert.equal(hide_id, '.empty_feed_notice');
|
||||
assert.equal(show_id, '#empty_narrow_group_private_message');
|
||||
|
||||
set_filter([['sender', 'ray@example.com']]);
|
||||
narrow.show_empty_narrow_message();
|
||||
assert.equal(hide_id,'.empty_feed_notice');
|
||||
assert.equal(hide_id, '.empty_feed_notice');
|
||||
assert.equal(show_id, '#silent_user');
|
||||
|
||||
set_filter([['sender', 'sinwar@example.com']]);
|
||||
narrow.show_empty_narrow_message();
|
||||
assert.equal(hide_id,'.empty_feed_notice');
|
||||
assert.equal(hide_id, '.empty_feed_notice');
|
||||
assert.equal(show_id, '#non_existing_user');
|
||||
|
||||
set_filter([['search', 'grail']]);
|
||||
narrow.show_empty_narrow_message();
|
||||
assert.equal(hide_id,'.empty_feed_notice');
|
||||
assert.equal(hide_id, '.empty_feed_notice');
|
||||
assert.equal(show_id, '#empty_search_narrow_message');
|
||||
});
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ zrequire('schema');
|
|||
|
||||
run_test('basics', () => {
|
||||
assert.equal(schema.check_string('x', 'fred'), undefined);
|
||||
assert.equal(schema.check_string('x', [1,2]), 'x is not a string');
|
||||
assert.equal(schema.check_string('x', [1, 2]), 'x is not a string');
|
||||
|
||||
const fields = {
|
||||
foo: schema.check_string,
|
||||
|
|
|
@ -106,10 +106,10 @@ run_test('event_dispatch_error', () => {
|
|||
|
||||
const logs = blueslip.get_test_logs('error');
|
||||
assert.equal(logs.length, 1);
|
||||
assert.equal(logs[0].more_info.event.type , 'stream');
|
||||
assert.equal(logs[0].more_info.event.op , 'update');
|
||||
assert.equal(logs[0].more_info.event.id , 1);
|
||||
assert.equal(logs[0].more_info.other , undefined);
|
||||
assert.equal(logs[0].more_info.event.type, 'stream');
|
||||
assert.equal(logs[0].more_info.event.op, 'update');
|
||||
assert.equal(logs[0].more_info.event.id, 1);
|
||||
assert.equal(logs[0].more_info.other, undefined);
|
||||
blueslip.clear_test_data();
|
||||
});
|
||||
|
||||
|
|
|
@ -419,11 +419,11 @@ run_test('alert_word_settings_item', () => {
|
|||
var li = $(html).find("li.alert-word-item:first");
|
||||
var value = li.find('.value');
|
||||
var button = li.find('button');
|
||||
assert.equal(li.attr('data-word'),'lunch');
|
||||
assert.equal(li.attr('data-word'), 'lunch');
|
||||
assert.equal(value.length, 1);
|
||||
assert.equal(value.text(), 'lunch');
|
||||
assert.equal(button.attr('title'), 'translated: Delete alert word');
|
||||
assert.equal(button.attr('data-word'),'lunch');
|
||||
assert.equal(button.attr('data-word'), 'lunch');
|
||||
|
||||
var title = $(html).find('.new-alert-word-section-title');
|
||||
var textbox = $(html).find('#create_alert_word_name');
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
set_global('$', global.make_zjquery());
|
||||
set_global('i18n', global.stub_i18n);
|
||||
set_global('page_params' , {
|
||||
set_global('page_params', {
|
||||
twenty_four_hour_time: true,
|
||||
});
|
||||
zrequire('XDate', 'xdate');
|
||||
|
|
|
@ -126,10 +126,10 @@ run_test('is_mobile', () => {
|
|||
|
||||
run_test('array_compare', () => {
|
||||
assert(util.array_compare([], []));
|
||||
assert(util.array_compare([1,2,3], [1,2,3]));
|
||||
assert(!util.array_compare([1,2], [1,2,3]));
|
||||
assert(!util.array_compare([1,2,3], [1,2]));
|
||||
assert(!util.array_compare([1,2,3,4], [1,2,3,5]));
|
||||
assert(util.array_compare([1, 2, 3], [1, 2, 3]));
|
||||
assert(!util.array_compare([1, 2], [1, 2, 3]));
|
||||
assert(!util.array_compare([1, 2, 3], [1, 2]));
|
||||
assert(!util.array_compare([1, 2, 3, 4], [1, 2, 3, 5]));
|
||||
});
|
||||
|
||||
run_test('normalize_recipients', () => {
|
||||
|
|
|
@ -16,7 +16,7 @@ const difflib = require('difflib');
|
|||
|
||||
function apply_color(input_string, changes) {
|
||||
let previous_index = 0;
|
||||
let processed_string = input_string.slice(0,2);
|
||||
let processed_string = input_string.slice(0, 2);
|
||||
input_string = input_string.slice(2);
|
||||
|
||||
const formatter = {
|
||||
|
@ -116,7 +116,7 @@ function diff_strings(string_0, string_1) {
|
|||
});
|
||||
|
||||
const emphasize_codes = (string) => {
|
||||
return "\u001b[34m" + string.slice(0,1) + "\u001b[0m" + string.slice(1);
|
||||
return "\u001b[34m" + string.slice(0, 1) + "\u001b[0m" + string.slice(1);
|
||||
};
|
||||
output_lines = _.map(output_lines, emphasize_codes);
|
||||
|
||||
|
|
Loading…
Reference in New Issue