From 168e54a17a86c327f51eb5fad446d6e2f41d7711 Mon Sep 17 00:00:00 2001 From: Felix Hammerl Date: Tue, 2 Feb 2016 19:16:25 +0100 Subject: 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. --- .../test/spec/mail_view/ui/attachment_icon.spec.js | 25 +++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'web-ui/test/spec/mail_view/ui/attachment_icon.spec.js') 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(''); }); - 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); + }); + }); }); -- cgit v1.2.3