From 9308560b5114f2c349558f8e984b105c225aefa7 Mon Sep 17 00:00:00 2001 From: Christoph Kluenter Date: Tue, 23 Aug 2016 17:15:02 +0200 Subject: accept uploads to up to 5MB --- service/test/functional/features/attachments.feature | 2 +- service/test/functional/features/files/5mb.daata | Bin 0 -> 5485760 bytes service/test/functional/features/steps/attachments.py | 4 ++-- web-ui/app/js/mail_view/ui/attachment_list.js | 2 +- web-ui/test/spec/mail_view/ui/attachment_list.spec.js | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 service/test/functional/features/files/5mb.daata diff --git a/service/test/functional/features/attachments.feature b/service/test/functional/features/attachments.feature index 7724596d..ff0b99c9 100644 --- a/service/test/functional/features/attachments.feature +++ b/service/test/functional/features/attachments.feature @@ -32,7 +32,7 @@ Feature: Attachments | Pixelated rocks! | You should definitely use it. Cheers, User. | And for the 'To' field I enter 'pixelated@friends.org' And I find an attachment icon - When I try to upload a file bigger than 1MB + When I try to upload a file bigger than 5MB Then I see an upload error message When I dismiss the error message Then It should not show the error message anymore diff --git a/service/test/functional/features/files/5mb.daata b/service/test/functional/features/files/5mb.daata new file mode 100644 index 00000000..c8908818 Binary files /dev/null and b/service/test/functional/features/files/5mb.daata differ diff --git a/service/test/functional/features/steps/attachments.py b/service/test/functional/features/steps/attachments.py index c086dfcc..1805e094 100644 --- a/service/test/functional/features/steps/attachments.py +++ b/service/test/functional/features/steps/attachments.py @@ -60,10 +60,10 @@ def find_icon(context): assert find_element_by_css_selector(context, '#attachment-button .fa.fa-paperclip') -@when(u'I try to upload a file bigger than 1MB') +@when(u'I try to upload a file bigger than 5MB') def upload_big_file(context): base_dir = "test/functional/features/files/" - fname = "image_over_1MB.png" + fname = "5mb.data" context.browser.execute_script("$('#fileupload').removeAttr('hidden');") fill_by_css_selector(context, '#fileupload', base_dir + fname) wait_until_element_is_visible_by_locator(context, (By.CSS_SELECTOR, '#upload-error-message')) diff --git a/web-ui/app/js/mail_view/ui/attachment_list.js b/web-ui/app/js/mail_view/ui/attachment_list.js index fc4c0544..4ef64960 100644 --- a/web-ui/app/js/mail_view/ui/attachment_list.js +++ b/web-ui/app/js/mail_view/ui/attachment_list.js @@ -42,7 +42,7 @@ define( }); var ONE_MEGABYTE = 1024*1024; - var ATTACHMENT_SIZE_LIMIT = ONE_MEGABYTE; + var ATTACHMENT_SIZE_LIMIT = 5*ONE_MEGABYTE; this.showAttachment = function (ev, data) { this.trigger(document, events.mail.appendAttachment, data); 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 c0e2a5ef..2b430c28 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 @@ -106,15 +106,15 @@ describeMixin('mail_view/ui/attachment_list', function () { describe('File size check', function (){ var ONE_MEGABYTE = 1024*1024; - var largeAttachment = {originalFiles: [{size: ONE_MEGABYTE+1}]}; + var largeAttachment = {originalFiles: [{size: 5*ONE_MEGABYTE+1}]}; - it('should reject files larger than 1MB', function () { + it('should reject files larger than 5MB', function () { var uploadAccepted = this.component.performPreUploadCheck(null, largeAttachment); expect(uploadAccepted).toBe(false); }); - it('should accept files less or equal 1MB', function () { - var smallAttachment = {originalFiles: [{size: ONE_MEGABYTE}]}; + it('should accept files less or equal 5MB', function () { + var smallAttachment = {originalFiles: [{size: 5*ONE_MEGABYTE}]}; var uploadAccepted = this.component.performPreUploadCheck(null, smallAttachment); expect(uploadAccepted).toBe(true); -- cgit v1.2.3 From 0cc753ce7b525b9b940818cda831750a72131938 Mon Sep 17 00:00:00 2001 From: Denis Costa Date: Tue, 23 Aug 2016 17:12:40 -0300 Subject: Fix misspelled attachment name See: #761 --- service/test/functional/features/files/5mb.daata | Bin 5485760 -> 0 bytes service/test/functional/features/files/over_5mb.data | Bin 0 -> 5485760 bytes service/test/functional/features/steps/attachments.py | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 service/test/functional/features/files/5mb.daata create mode 100644 service/test/functional/features/files/over_5mb.data diff --git a/service/test/functional/features/files/5mb.daata b/service/test/functional/features/files/5mb.daata deleted file mode 100644 index c8908818..00000000 Binary files a/service/test/functional/features/files/5mb.daata and /dev/null differ diff --git a/service/test/functional/features/files/over_5mb.data b/service/test/functional/features/files/over_5mb.data new file mode 100644 index 00000000..c8908818 Binary files /dev/null and b/service/test/functional/features/files/over_5mb.data differ diff --git a/service/test/functional/features/steps/attachments.py b/service/test/functional/features/steps/attachments.py index 1805e094..8b01a28a 100644 --- a/service/test/functional/features/steps/attachments.py +++ b/service/test/functional/features/steps/attachments.py @@ -63,7 +63,7 @@ def find_icon(context): @when(u'I try to upload a file bigger than 5MB') def upload_big_file(context): base_dir = "test/functional/features/files/" - fname = "5mb.data" + fname = "over_5mb.data" context.browser.execute_script("$('#fileupload').removeAttr('hidden');") fill_by_css_selector(context, '#fileupload', base_dir + fname) wait_until_element_is_visible_by_locator(context, (By.CSS_SELECTOR, '#upload-error-message')) -- cgit v1.2.3