summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/mail_view/ui/attachment_icon.spec.js
diff options
context:
space:
mode:
authorFelix Hammerl <fhammerl@thoughtworks.com>2016-02-02 19:16:25 +0100
committerFelix Hammerl <fhammerl@thoughtworks.com>2016-02-03 10:36:35 +0100
commit168e54a17a86c327f51eb5fad446d6e2f41d7711 (patch)
treecbd71260d9e86a7156d6fc08e3b336ee25272931 /web-ui/test/spec/mail_view/ui/attachment_icon.spec.js
parent6dae3002dc59d09eff07a7c0c6d22ca52d34f678 (diff)
Display progress bar when an upload is in progress
Displays a progress bar when an upload is in progress and prohibits uploading multiple attachments in parallel.
Diffstat (limited to 'web-ui/test/spec/mail_view/ui/attachment_icon.spec.js')
-rw-r--r--web-ui/test/spec/mail_view/ui/attachment_icon.spec.js25
1 files changed, 24 insertions, 1 deletions
diff --git a/web-ui/test/spec/mail_view/ui/attachment_icon.spec.js b/web-ui/test/spec/mail_view/ui/attachment_icon.spec.js
index c60d6f7e..1b2f182e 100644
--- a/web-ui/test/spec/mail_view/ui/attachment_icon.spec.js
+++ b/web-ui/test/spec/mail_view/ui/attachment_icon.spec.js
@@ -11,11 +11,34 @@ describeComponent('mail_view/ui/attachment_icon', function () {
expect(this.$node.html()).toMatch('<i class="fa fa-paperclip"></i>');
});
- it('should trigger starts of attachment upload process', function () {
+ it('should be busy', function() {
+ this.component.uploadInProgress();
+
+ expect(this.component.attr.busy).toBe(true);
+ });
+
+ it('should not be busy', function() {
+ this.component.uploadFinished();
+
+ expect(this.component.attr.busy).toBe(false);
+ });
+
+ it('should trigger start of attachment upload process', function () {
var triggerUploadAttachment = spyOnEvent(document, Pixelated.events.mail.startUploadAttachment);
+
this.$node.click();
+
expect(triggerUploadAttachment).toHaveBeenTriggeredOn(document);
});
+ it('should not trigger attachment upload when busy', function () {
+ this.component.uploadInProgress();
+ var triggerUploadAttachment = spyOnEvent(document, Pixelated.events.mail.startUploadAttachment);
+
+ this.$node.click();
+
+ expect(triggerUploadAttachment).not.toHaveBeenTriggeredOn(document);
+ });
+
});
});