From 716a4a967d66794bd3e226762fa860b61fe21083 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Sun, 6 May 2018 16:42:17 -0700 Subject: [PATCH] js: Fix indentation issues in casper tests. Our casper tests now pass eslint cleanly. --- .../casper_tests/00-realm-creation.js | 4 ++-- frontend_tests/casper_tests/02-site.js | 8 ++++---- frontend_tests/casper_tests/03-narrow.js | 16 ++++++++-------- .../casper_tests/05-subscriptions.js | 4 ++-- frontend_tests/casper_tests/06-settings.js | 18 +++++++++--------- frontend_tests/casper_tests/07-stars.js | 6 +++--- frontend_tests/casper_tests/10-admin.js | 8 ++++---- frontend_tests/casper_tests/11-mention.js | 3 ++- 8 files changed, 34 insertions(+), 33 deletions(-) diff --git a/frontend_tests/casper_tests/00-realm-creation.js b/frontend_tests/casper_tests/00-realm-creation.js index 2aa1f65d2b..fe38896c44 100644 --- a/frontend_tests/casper_tests/00-realm-creation.js +++ b/frontend_tests/casper_tests/00-realm-creation.js @@ -17,8 +17,8 @@ casper.then(function () { }); // Make sure confirmation email is send this.waitWhileVisible('form[action^="/new/"]', function () { - var regex = new RegExp('^http://[^/]+/accounts/send_confirm/' + email); - this.test.assertUrlMatch(regex, 'Confirmation mail send'); + var regex = new RegExp('^http://[^/]+/accounts/send_confirm/' + email); + this.test.assertUrlMatch(regex, 'Confirmation mail send'); }); }); diff --git a/frontend_tests/casper_tests/02-site.js b/frontend_tests/casper_tests/02-site.js index 42c5e776ed..e58db112c4 100644 --- a/frontend_tests/casper_tests/02-site.js +++ b/frontend_tests/casper_tests/02-site.js @@ -19,14 +19,14 @@ casper.then(function () { msg.headings.forEach(function (heading) { casper.test.assertMatch(common.normalize_spaces(heading), - /(^You and )|( )/, - 'Heading is well-formed'); + /(^You and )|( )/, + 'Heading is well-formed'); }); msg.bodies.forEach(function (body) { casper.test.assertMatch(body, - /^(

(.|\n)*<\/p>)?$/, - 'Body is well-formed'); + /^(

(.|\n)*<\/p>)?$/, + 'Body is well-formed'); }); casper.test.info('Sending messages'); diff --git a/frontend_tests/casper_tests/03-narrow.js b/frontend_tests/casper_tests/03-narrow.js index 35e73b7247..465f0bf1fb 100644 --- a/frontend_tests/casper_tests/03-narrow.js +++ b/frontend_tests/casper_tests/03-narrow.js @@ -351,14 +351,14 @@ casper.then(function () { casper.waitForSelector('#stream_filters [data-stream-name="Scotland"].highlighted_stream', function () { casper.test.info('Suggestion highlighting - after arrow key navigation'); casper.test.assertDoesntExist( - '#stream_filters [data-stream-name="Denmark"].highlighted_stream', - 'Stream Denmark is not highlighted'); + '#stream_filters [data-stream-name="Denmark"].highlighted_stream', + 'Stream Denmark is not highlighted'); casper.test.assertExist( - '#stream_filters [data-stream-name="Scotland"].highlighted_stream', - 'Stream Scotland is highlighted'); + '#stream_filters [data-stream-name="Scotland"].highlighted_stream', + 'Stream Scotland is highlighted'); casper.test.assertDoesntExist( - '#stream_filters [data-stream-name="Verona"].highlighted_stream', - 'Stream Verona is not highlighted'); + '#stream_filters [data-stream-name="Verona"].highlighted_stream', + 'Stream Verona is not highlighted'); }); // We search for the beginning of "Scotland", not case sensitive @@ -490,9 +490,9 @@ casper.then(function () { casper.waitForSelector('#user_presences li.highlighted_user [data-name="King Hamlet"]', function () { casper.test.info('Suggestion highlighting - after arrow key navigation'); casper.test.assertDoesntExist('#user_presences li.highlighted_user [data-name="Cordelia Lear"]', - 'User Cordelia Lear not is selected'); + 'User Cordelia Lear not is selected'); casper.test.assertExist('#user_presences li.highlighted_user [data-name="King Hamlet"]', - 'User King Hamlet is selected'); + 'User King Hamlet is selected'); }); common.then_log_out(); diff --git a/frontend_tests/casper_tests/05-subscriptions.js b/frontend_tests/casper_tests/05-subscriptions.js index 251e0958e7..ae2e43d628 100644 --- a/frontend_tests/casper_tests/05-subscriptions.js +++ b/frontend_tests/casper_tests/05-subscriptions.js @@ -160,8 +160,8 @@ casper.then(function () { casper.then(function () { casper.fill('form#add_new_subscription', {stream_name: 'was'}); casper.evaluate(function () { - $('#add_new_subscription input[type="text"]').expectOne() - .trigger($.Event('input')); + $('#add_new_subscription input[type="text"]').expectOne() + .trigger($.Event('input')); }); }); casper.waitForSelectorTextChange('form#add_new_subscription', function () { diff --git a/frontend_tests/casper_tests/06-settings.js b/frontend_tests/casper_tests/06-settings.js index 460fe35758..4ab1061a42 100644 --- a/frontend_tests/casper_tests/06-settings.js +++ b/frontend_tests/casper_tests/06-settings.js @@ -166,15 +166,15 @@ casper.then(function () { var form_sel = '.edit_bot_form[data-email="' + bot_email + '"]'; casper.test.info('Testing edit bot form values'); - // casper.test.assertEqual( - // common.get_form_field_value(form_sel + ' [name=bot_name]'), - // 'Bot 1'); - // casper.test.assertEqual( - // common.get_form_field_value(form_sel + ' [name=bot_default_sending_stream]'), - // 'Denmark'); - // casper.test.assertEqual( - // common.get_form_field_value(form_sel + ' [name=bot_default_events_register_stream]'), - // 'Rome'); + // casper.test.assertEqual( + // common.get_form_field_value(form_sel + ' [name=bot_name]'), + // 'Bot 1'); + // casper.test.assertEqual( + // common.get_form_field_value(form_sel + ' [name=bot_default_sending_stream]'), + // 'Denmark'); + // casper.test.assertEqual( + // common.get_form_field_value(form_sel + ' [name=bot_default_events_register_stream]'), + // 'Rome'); casper.test.assertEqual( common.get_form_field_value(form_sel + ' [name=bot_name]'), 'Bot 1'); diff --git a/frontend_tests/casper_tests/07-stars.js b/frontend_tests/casper_tests/07-stars.js index 29d7047bd6..532b649f23 100644 --- a/frontend_tests/casper_tests/07-stars.js +++ b/frontend_tests/casper_tests/07-stars.js @@ -19,9 +19,9 @@ casper.then(function () { }); common.then_send_message('stream', { - stream: 'Verona', - subject: 'stars', - content: 'test star', + stream: 'Verona', + subject: 'stars', + content: 'test star', }); casper.then(function () { diff --git a/frontend_tests/casper_tests/10-admin.js b/frontend_tests/casper_tests/10-admin.js index e43b4bbff2..d3acdf9715 100644 --- a/frontend_tests/casper_tests/10-admin.js +++ b/frontend_tests/casper_tests/10-admin.js @@ -287,9 +287,9 @@ function get_suggestions(str) { casper.then(function () { casper.evaluate(function (str) { $('.create_default_stream') - .focus() - .val(str) - .trigger($.Event('keyup', { which: 0 })); + .focus() + .val(str) + .trigger($.Event('keyup', { which: 0 })); }, str); }); } @@ -350,7 +350,7 @@ casper.then(function () { // Hack: Rather than submitting the form, we just fill the // form and then trigger a click event by clicking the button. casper.fill('form.admin-realm-form', { - realm_icon_file_input: 'static/images/logo/zulip-icon-128x128.png', + realm_icon_file_input: 'static/images/logo/zulip-icon-128x128.png', }, false); casper.click("#realm_icon_upload_button"); casper.waitWhileVisible("#upload_icon_spinner .loading_indicator_spinner", function () { diff --git a/frontend_tests/casper_tests/11-mention.js b/frontend_tests/casper_tests/11-mention.js index 26e06eebf1..675129be65 100644 --- a/frontend_tests/casper_tests/11-mention.js +++ b/frontend_tests/casper_tests/11-mention.js @@ -47,7 +47,8 @@ casper.then(function () { casper.then(function () { common.expected_messages('zhome', ['Verona > Test mention all'], - ["

@all

"]); + ["

@all

"]); });