summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/mail_view/ui/attachment_icon.spec.js
diff options
context:
space:
mode:
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);
+ });
+
});
});