From 2e7d411ef86a9783953db52ff5044bcf3186eb98 Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Wed, 23 Jan 2013 13:29:44 -0500 Subject: [PATCH] Remove redundant success messages from subscriptions page The fact that the user sees a change (the button changes or a row appears) makes it obvious that the operation was a success. The success messages were only serving to make the page scroll confusingly when you couldn't see the top. (imported from commit 471b9304f71bb8533c98d208b855d4d75c04a886) --- zephyr/static/js/subs.js | 4 ---- zephyr/tests/frontend/tests/site.js | 4 +--- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/zephyr/static/js/subs.js b/zephyr/static/js/subs.js index 52fab4f38e..249ba03251 100644 --- a/zephyr/static/js/subs.js +++ b/zephyr/static/js/subs.js @@ -295,8 +295,6 @@ function ajaxSubscribe(stream) { ui.report_success("Already subscribed to " + name, $("#subscriptions-status")); } else { name = res.subscribed[0]; - ui.report_success("Successfully added subscription to " + name, - $("#subscriptions-status")); } mark_subscribed(name); }, @@ -321,8 +319,6 @@ function ajaxUnsubscribe(stream) { $("#subscriptions-status")); } else { name = res.removed[0]; - ui.report_success("Successfully removed subscription to " + name, - $("#subscriptions-status")); } mark_unsubscribed(name); }, diff --git a/zephyr/tests/frontend/tests/site.js b/zephyr/tests/frontend/tests/site.js index 9a7af7011e..2689bc6f45 100644 --- a/zephyr/tests/frontend/tests/site.js +++ b/zephyr/tests/frontend/tests/site.js @@ -312,9 +312,7 @@ casper.then(function() { casper.waitForText('Waseemio'); }); casper.then(function() { - // TODO: Make this more robust. - // I tried to do it with assertSelectorHasText, but it wasn't quite working. - casper.test.assertTextExists('Successfully added subscription to Waseemio', 'Subscribing to a stream'); + casper.test.assertSelectorHasText('.subscription_name', 'Waseemio', 'Subscribing to a stream'); casper.fill('form#add_new_subscription', {stream_name: 'WASeemio'}); casper.click('form#add_new_subscription input.btn.btn-primary'); casper.waitForText('Already subscribed');