From 451b2fbf67780c49afc609b584f4de71ce7d913b Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Fri, 29 Jan 2016 15:11:45 -0300 Subject: Testing Choose another file and dismiss buttons. Issue #550 --- .../test/spec/mail_view/ui/attachment_list.spec.js | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'web-ui/test') 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 () { -- cgit v1.2.3