diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-09-04 19:58:49 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-09-04 20:18:24 +0200 |
commit | f1bfe35cda2f11d1b38726cf2d4f879427b2c8d5 (patch) | |
tree | 227884fd46ddbeea15702b1aba14b56644ff05ce /apps/files/tests | |
parent | 1a7df3323391f6d6f7ef04de2687b3a566ab6351 (diff) | |
download | nextcloud-server-f1bfe35cda2f11d1b38726cf2d4f879427b2c8d5.tar.gz nextcloud-server-f1bfe35cda2f11d1b38726cf2d4f879427b2c8d5.zip |
Added permission check for drag and drop
When dropping files onto a read-only folder, a notification
is now shown instead of attempting to upload.
This for both the drag for upload and drag from inside the file list
cases.
Diffstat (limited to 'apps/files/tests')
-rw-r--r-- | apps/files/tests/js/filelistSpec.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js index cad564323b4..65a89ef85cd 100644 --- a/apps/files/tests/js/filelistSpec.js +++ b/apps/files/tests/js/filelistSpec.js @@ -1835,7 +1835,6 @@ describe('OCA.Files.FileList tests', function() { // but it makes it possible to simulate the event triggering to // test the response of the handlers $uploader = $('#file_upload_start'); - fileList.setupUploadEvents(); fileList.setFiles(testFiles); }); @@ -1912,6 +1911,16 @@ describe('OCA.Files.FileList tests', function() { ev = dropOn(fileList.$fileList.find('th:first')); expect(ev.result).toEqual(false); + expect(notificationStub.calledOnce).toEqual(true); + }); + it('drop on an folder does not trigger upload if no upload permission on that folder', function() { + var $tr = fileList.findFileEl('somedir'); + var ev; + $tr.data('permissions', OC.PERMISSION_READ); + ev = dropOn($tr); + + expect(ev.result).toEqual(false); + expect(notificationStub.calledOnce).toEqual(true); }); it('drop on a file row inside the table triggers upload to current folder', function() { var ev; |