diff options
author | Victor Shyba <victor.shyba@gmail.com> | 2016-01-29 15:11:45 -0300 |
---|---|---|
committer | Victor Shyba <victor.shyba@gmail.com> | 2016-01-29 15:11:45 -0300 |
commit | 451b2fbf67780c49afc609b584f4de71ce7d913b (patch) | |
tree | 66a7eaea8fd3b3afde5a2f984e86bbc485d8bc90 /web-ui/test | |
parent | 5775ac239f4d9a7556bd1a3fa07c72cef175bb85 (diff) |
Testing Choose another file and dismiss buttons.
Issue #550
Diffstat (limited to 'web-ui/test')
-rw-r--r-- | web-ui/test/spec/mail_view/ui/attachment_list.spec.js | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/web-ui/test/spec/mail_view/ui/attachment_list.spec.js b/web-ui/test/spec/mail_view/ui/attachment_list.spec.js index a98267b1..d0133bc5 100644 --- a/web-ui/test/spec/mail_view/ui/attachment_list.spec.js +++ b/web-ui/test/spec/mail_view/ui/attachment_list.spec.js @@ -51,8 +51,30 @@ describeMixin('mail_view/ui/attachment_list', function () { expect(this.component.select('uploadError').html()).toContain('Upload failed. This file exceeds the 1MB limit.'); }); - xit('should dismiss upload failed message when clicking close icon', function () { + it('should dismiss upload failed message when clicking close icon', function () { + this.component.checkAttachmentSize(dummyEvent, largeAttachment); + + this.component.select('closeIcon').click(); + + expect(this.component.select('uploadError').html()).toBe(undefined); + }); + + it('should dismiss upload failed message when clicking dismiss button', function () { + this.component.checkAttachmentSize(dummyEvent, largeAttachment); + + this.component.select('dismissButton').click(); + + expect(this.component.select('uploadError').html()).toBe(undefined); + }); + + it('should start file upload when clicking Choose another file button', function () { + this.component.checkAttachmentSize(dummyEvent, largeAttachment); + + var triggerUploadAttachment = spyOnEvent(document, Pixelated.events.mail.startUploadAttachment); + + this.component.select('uploadFileButton').click(); + expect(triggerUploadAttachment).toHaveBeenTriggeredOn(document); }); it('should not upload files larger than 1MB', function () { |