summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/mail_view/ui
diff options
context:
space:
mode:
authorFolker Bernitt <fbernitt@thoughtworks.com>2016-02-01 10:54:43 +0100
committerFolker Bernitt <fbernitt@thoughtworks.com>2016-02-01 10:54:43 +0100
commit7b9103387f9c0405cb19f6b1add8972a804bfbd8 (patch)
tree793a4e02ef149276192a249791439e503eb4a619 /web-ui/test/spec/mail_view/ui
parent451b2fbf67780c49afc609b584f4de71ce7d913b (diff)
Check exactly at border limit of one megabyte
- Issue #550 - Deleted skipped test
Diffstat (limited to 'web-ui/test/spec/mail_view/ui')
-rw-r--r--web-ui/test/spec/mail_view/ui/attachment_list.spec.js22
1 files changed, 4 insertions, 18 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 d0133bc5..20f82704 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
@@ -40,9 +40,10 @@ describeMixin('mail_view/ui/attachment_list', function () {
});
describe('Upload files -- max file size -- ', function (){
+ var ONE_MEGABYTE = 1024*1024;
var submitFile = 'file not submitted', submitted = 'file submitted';
var mockSubmit = function (){ submitFile = submitted; };
- var largeAttachment = {originalFiles: [{size: 4500000}], submit: mockSubmit};
+ var largeAttachment = {originalFiles: [{size: ONE_MEGABYTE+1}], submit: mockSubmit};
var dummyEvent = 'whatever, not used';
it('should show error messages on the dom, when uploading files larger than 1MB', function () {
@@ -85,27 +86,12 @@ describeMixin('mail_view/ui/attachment_list', function () {
expect(largeAttachment.submit).not.toHaveBeenCalled();
});
- it('should upload files smaller than 1MB', function () {
- var smallAttachment = {originalFiles: [{size: 450}], submit: mockSubmit};
+ it('should upload files less or equal 1MB', function () {
+ var smallAttachment = {originalFiles: [{size: ONE_MEGABYTE}], submit: mockSubmit};
this.component.checkAttachmentSize(dummyEvent, smallAttachment);
expect(submitFile).toEqual(submitted);
});
});
-
- xit('should start uploading attachments', function () {
- var stubAttachment = {ident: 'faked', name: 'haha.txt', size: 4500};
- var mockAjax = spyOn($, 'ajax').and.callFake(function (params) {params.success(stubAttachment);});
- var uploadedAttachment = spyOnEvent(document, Pixelated.events.mail.uploadedAttachment);
- var uploading = spyOnEvent(document, Pixelated.events.mail.uploadingAttachment);
-
- $(document).trigger(Pixelated.events.mail.startUploadAttachment);
-
- expect(mockAjax).toHaveBeenCalled();
- expect(uploadedAttachment).toHaveBeenTriggeredOnAndWith(document, stubAttachment);
- expect(uploading).toHaveBeenTriggeredOn(document);
- });
-
});
-
});