diff --git a/frontend_tests/casper_tests/13-user-deactivation.js b/frontend_tests/casper_tests/13-user-deactivation.js index 021676fc7c..6327363b74 100644 --- a/frontend_tests/casper_tests/13-user-deactivation.js +++ b/frontend_tests/casper_tests/13-user-deactivation.js @@ -25,7 +25,7 @@ casper.then(function () { // Test user deactivation and reactivation casper.then(function () { casper.waitUntilVisible(user_row('cordelia'), function () { - casper.test.assertSelectorHasText(user_row('cordelia'), 'Deactivate'); + casper.test.assertExists('.fa-user-times', 'Deactivate icon available'); casper.click(user_row('cordelia') + ' .deactivate'); casper.test.assertTextExists('Deactivate cordelia@zulip.com', 'Deactivate modal has right user'); casper.test.assertTextExists('Deactivate now', 'Deactivate now button available'); @@ -35,21 +35,21 @@ casper.then(function () { casper.then(function () { casper.waitUntilVisible(user_row('cordelia') + '.deactivated_user', function () { - casper.test.assertSelectorHasText(user_row('cordelia'), 'Reactivate'); + casper.test.assertExists('.fa-user-plus', 'Reactivate icon available'); casper.click(user_row('cordelia') + ' .reactivate'); }); }); casper.then(function () { casper.waitUntilVisible(user_row('cordelia') + ':not(.deactivated_user)', function () { - casper.test.assertSelectorHasText(user_row('cordelia'), 'Deactivate'); + casper.test.assertExists('.fa-user-times', 'Deactivate icon available'); }); }); casper.then(function () { // Test Deactivated users section of admin page casper.waitUntilVisible(user_row('cordelia'), function () { - casper.test.assertSelectorHasText(user_row('cordelia'), 'Deactivate'); + casper.test.assertExists('.fa-user-times', 'Deactivate icon available'); casper.click(user_row('cordelia') + ' .deactivate'); casper.test.assertTextExists('Deactivate cordelia@zulip.com', 'Deactivate modal has right user'); casper.test.assertTextExists('Deactivate now', 'Deactivate now button available'); @@ -66,14 +66,14 @@ casper.then(function () { casper.waitUntilVisible('#admin_deactivated_users_table ' + user_row('cordelia') + ' .reactivate', function () { - casper.test.assertSelectorHasText('#admin_deactivated_users_table ' + user_row('cordelia') + '', 'Reactivate'); + casper.test.assertExists('.fa-user-plus', 'Reactive icon available'); casper.click('#admin_deactivated_users_table ' + user_row('cordelia') + ' .reactivate'); }); }); casper.then(function () { casper.waitUntilVisible('#admin_deactivated_users_table ' + user_row('cordelia') + ' button:not(.reactivate)', function () { - casper.test.assertSelectorHasText('#admin_deactivated_users_table ' + user_row('cordelia') + '', 'Deactivate'); + casper.test.assertExists('.fa-user-times', 'Deactivate icon available'); }); }); @@ -85,21 +85,21 @@ casper.then(function () { casper.then(function () { casper.waitUntilVisible(user_row('default-bot'), function () { - casper.test.assertSelectorHasText(user_row('default-bot'), 'Deactivate'); + casper.test.assertExists('.fa-user-times', 'Deactivate icon available'); casper.click(user_row('default-bot') + ' .deactivate'); }); }); casper.then(function () { casper.waitUntilVisible(user_row('default-bot') + '.deactivated_user', function () { - casper.test.assertSelectorHasText(user_row('default-bot'), 'Reactivate'); + casper.test.assertExists('.fa-user-plus', 'Reactivate icon available'); casper.click(user_row('default-bot') + ' .reactivate'); }); }); casper.then(function () { casper.waitUntilVisible(user_row('default-bot') + ':not(.deactivated_user)', function () { - casper.test.assertSelectorHasText(user_row('default-bot'), 'Deactivate'); + casper.test.assertExists('.fa-user-times', 'Deactivate icon available'); }); }); diff --git a/static/js/settings_users.js b/static/js/settings_users.js index 1230160a35..b520d4ae23 100644 --- a/static/js/settings_users.js +++ b/static/js/settings_users.js @@ -78,7 +78,8 @@ function update_view_on_deactivate(row) { row.find('i.deactivated-user-icon').show(); button.addClass("btn-warning reactivate"); button.removeClass("deactivate btn-danger"); - button.text(i18n.t("Reactivate")); + button.html(""); + button.attr('title', 'Reactivate'); row.addClass("deactivated_user"); if (user_role) { @@ -95,7 +96,8 @@ function update_view_on_reactivate(row) { row.find('i.deactivated-user-icon').hide(); button.addClass("btn-danger deactivate"); button.removeClass("btn-warning reactivate"); - button.text(i18n.t("Deactivate")); + button.attr('title', 'Deactivate'); + button.html(''); row.removeClass("deactivated_user"); if (user_role) { diff --git a/static/styles/right-sidebar.scss b/static/styles/right-sidebar.scss index f69c915421..1e7bb93c42 100644 --- a/static/styles/right-sidebar.scss +++ b/static/styles/right-sidebar.scss @@ -120,9 +120,10 @@ .user-presence-link { width: calc(100% - 24px); - .my_user_status { - opacity: 0.5; - } +} + +.my_user_status { + opacity: 0.5; } .group-pm-link { diff --git a/static/templates/admin_user_list.hbs b/static/templates/admin_user_list.hbs index f8b1bdf704..02927448b2 100644 --- a/static/templates/admin_user_list.hbs +++ b/static/templates/admin_user_list.hbs @@ -1,7 +1,7 @@ {{#with user}}