alert settings: Include the actual alert word in the success message.

The message now says 'Alert word "foo" added successfully!' when
you add "foo" as an alert word.
This commit is contained in:
Abhishek-Balaji 2020-04-16 03:04:59 +05:30 committed by Tim Abbott
parent 9340cd1a0b
commit 255fe13151
3 changed files with 4 additions and 3 deletions

View File

@ -238,7 +238,7 @@ casper.then(function () {
casper.click('#create_alert_word_button');
casper.test.info('Checking that a success message is displayed');
casper.waitUntilVisible('#alert_word_status', function () {
casper.test.assertSelectorHasText('.alert_word_status_text', 'Alert word added successfully!');
casper.test.assertSelectorHasText('.alert_word_status_text', 'Alert word \"some phrase\" added successfully!');
casper.test.info('Closing the status message');
casper.click('.close-alert-word-status');
casper.test.info('Checking the status message is hidden');

View File

@ -88,7 +88,7 @@ run_test('add_alert_word', () => {
// test success
success_func();
assert(alert_word_status.hasClass('alert-success'));
assert.equal(alert_word_status_text.text(), "translated: Alert word added successfully!");
assert.equal(alert_word_status_text.text(), "translated: Alert word \"zot\" added successfully!");
assert(alert_word_status.visible());
});

View File

@ -51,7 +51,8 @@ function add_alert_word(alert_word) {
url: '/json/users/me/alert_words',
data: {alert_words: JSON.stringify(words_to_be_added)},
success: function () {
update_alert_word_status(i18n.t("Alert word added successfully!"), false);
const message = "Alert word \"" + words_to_be_added + "\" added successfully!";
update_alert_word_status(i18n.t(message), false);
},
error: function () {
update_alert_word_status(i18n.t("Error adding alert word!"), true);