summaryrefslogtreecommitdiff
path: root/web-ui
diff options
context:
space:
mode:
authorLisa Junger <ljunger@thoughtworks.com>2014-10-28 16:01:17 +0100
committerLisa Junger <ljunger@thoughtworks.com>2014-10-28 16:13:22 +0100
commita1ac3eb200b8eb9eea764fe4ea761c9c6b319c7e (patch)
tree01c43cf830456f5e18ac6585cbe38474503f073e /web-ui
parent557fa0d17ff70a456669b25de69e4e6b180b374a (diff)
disables send button when triggered.
Diffstat (limited to 'web-ui')
-rw-r--r--web-ui/app/js/mail_view/ui/send_button.js3
-rw-r--r--web-ui/test/spec/mail_view/ui/send_button.spec.js11
2 files changed, 13 insertions, 1 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 a9852367..5e3986f3 100644
--- a/web-ui/app/js/mail_view/ui/send_button.js
+++ b/web-ui/app/js/mail_view/ui/send_button.js
@@ -78,6 +78,9 @@ define([
}.bind(this)));
this.trigger(document, events.ui.recipients.doCompleteInput);
+ this.disableButton();
+ this.$node.text('Sending...');
+
};
this.after('initialize', function () {
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 e97165f1..81e47803 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
@@ -6,7 +6,7 @@ describeComponent('mail_view/ui/send_button', function () {
describe('send button', function () {
beforeEach(function () {
- this.setupComponent('<button />');
+ this.setupComponent('<button>Send</button>');
});
describe('when it is disabled', function () {
@@ -74,6 +74,15 @@ describeComponent('mail_view/ui/send_button', function () {
expect(doCompleteInputEvent).toHaveBeenTriggeredOn(document);
});
+
+ it('disables the button after clicking', function () {
+ expect(this.$node.text()).toBe('Send');
+
+ this.$node.click();
+
+ expect(this.$node.text()).toBe('Sending...');
+ expect(this.$node.prop('disabled')).toBeTruthy();
+ });
});
describe('after clicking', function () {