diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-11-09 09:45:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-09 09:45:55 +0100 |
commit | e0aaca17263f15b3c14a1981c056da4040d5d98b (patch) | |
tree | f8fb3474044a4208ae4752e8e4b145ec9c039e2d /apps/files/tests | |
parent | eab2b3b7aee7734c5c1253a1be3896e0ecf7947c (diff) | |
parent | a9540fe99044fd26f5c876438ae83697dbd1fe8e (diff) | |
download | nextcloud-server-e0aaca17263f15b3c14a1981c056da4040d5d98b.tar.gz nextcloud-server-e0aaca17263f15b3c14a1981c056da4040d5d98b.zip |
Merge pull request #7046 from nextcloud/hide-summary-file-actions-when-selected-file-does-not-match
Hide summary file actions when a selected file does not match
Diffstat (limited to 'apps/files/tests')
-rw-r--r-- | apps/files/tests/js/filelistSpec.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js index 8bb188e3602..fd011474eb1 100644 --- a/apps/files/tests/js/filelistSpec.js +++ b/apps/files/tests/js/filelistSpec.js @@ -94,6 +94,7 @@ describe('OCA.Files.FileList tests', function() { '<input type="checkbox" id="select_all_files" class="select-all checkbox">' + '<a class="name columntitle" data-sort="name"><span>Name</span><span class="sort-indicator"></span></a>' + '<span id="selectedActionsList" class="selectedActions hidden">' + + '<a href class="copy-move">Move or copy</a>' + '<a href class="download"><img src="actions/download.svg">Download</a>' + '<a href class="delete-selected">Delete</a></span>' + '</th>' + @@ -2024,6 +2025,28 @@ describe('OCA.Files.FileList tests', function() { }); }); describe('Selection overlay', function() { + it('show doesnt show the copy/move action if one or more files are not copiable/movable', function () { + fileList.setFiles(testFiles); + $('#permissions').val(OC.PERMISSION_READ | OC.PERMISSION_UPDATE); + $('.select-all').click(); + expect(fileList.$el.find('.selectedActions .copy-move').hasClass('hidden')).toEqual(false); + testFiles[0].permissions = OC.PERMISSION_READ; + $('.select-all').click(); + fileList.setFiles(testFiles); + $('.select-all').click(); + expect(fileList.$el.find('.selectedActions .copy-move').hasClass('hidden')).toEqual(true); + }); + it('show doesnt show the download action if one or more files are not downloadable', function () { + fileList.setFiles(testFiles); + $('#permissions').val(OC.PERMISSION_READ | OC.PERMISSION_UPDATE); + $('.select-all').click(); + expect(fileList.$el.find('.selectedActions .download').hasClass('hidden')).toEqual(false); + testFiles[0].permissions = OC.PERMISSION_UPDATE; + $('.select-all').click(); + fileList.setFiles(testFiles); + $('.select-all').click(); + expect(fileList.$el.find('.selectedActions .download').hasClass('hidden')).toEqual(true); + }); it('show doesnt show the delete action if one or more files are not deletable', function () { fileList.setFiles(testFiles); $('#permissions').val(OC.PERMISSION_READ | OC.PERMISSION_DELETE); |