summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--web-ui/app/js/mail_view/ui/send_button.js2
-rw-r--r--web-ui/test/spec/mail_view/ui/send_button.spec.js9
2 files changed, 11 insertions, 0 deletions
diff --git a/web-ui/app/js/mail_view/ui/send_button.js b/web-ui/app/js/mail_view/ui/send_button.js
index 66fe1233..f31f893a 100644
--- a/web-ui/app/js/mail_view/ui/send_button.js
+++ b/web-ui/app/js/mail_view/ui/send_button.js
@@ -91,6 +91,8 @@ define([
this.disableButton();
this.$node.text(viewHelper.i18n.t('sending-mail'));
+ this.trigger(document, events.ui.userAlerts.displayMessage, {message: viewHelper.i18n.t('sending-mail'), class: 'success'});
+
this.attr.sendingInProgress = true;
this.trigger(document, events.ui.recipients.doCompleteInput);
diff --git a/web-ui/test/spec/mail_view/ui/send_button.spec.js b/web-ui/test/spec/mail_view/ui/send_button.spec.js
index f869362e..08806e54 100644
--- a/web-ui/test/spec/mail_view/ui/send_button.spec.js
+++ b/web-ui/test/spec/mail_view/ui/send_button.spec.js
@@ -95,6 +95,15 @@ describeComponent('mail_view/ui/send_button', function () {
expect(this.$node.prop('disabled')).toBeTruthy();
});
+ it('displays sending message', function () {
+ var displayMessageEvent = spyOnEvent(document, Pixelated.events.ui.userAlerts.displayMessage);
+
+ this.$node.click();
+
+ expect(displayMessageEvent).toHaveBeenTriggeredOnAndWith(document,
+ { message: 'Sending...', class: 'success' });
+ });
+
it('enables again if sending errors out', function() {
expect(this.$node.text()).toBe(i18n.t('send'));