summaryrefslogtreecommitdiffstats
path: root/apps/files/tests/js
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2017-11-02 14:55:58 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2017-11-02 19:37:00 +0100
commite6b74fac407b62168633be75312074e8ae0e2175 (patch)
treee573846ca7e0df0e7df6bd1b123f88ef6c0bdd65 /apps/files/tests/js
parent555d582f35d1704996c3bf72510a8272cc38f833 (diff)
downloadnextcloud-server-e6b74fac407b62168633be75312074e8ae0e2175.tar.gz
nextcloud-server-e6b74fac407b62168633be75312074e8ae0e2175.zip
Add proper handling of files without permissions
Now a file gets its directory permissions only if it contained no permissions (they were undefined or null), but not if its permissions were set to "NONE". Besides that, now file actions that do not require any permission on the file to be performed can be used on files that have no permissions. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'apps/files/tests/js')
-rw-r--r--apps/files/tests/js/filelistSpec.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index 8bb188e3602..8a3e8cb9d4b 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -296,6 +296,15 @@ describe('OCA.Files.FileList tests', function() {
expect($tr.find('.filesize').text()).toEqual('Pending');
expect($tr.find('.date').text()).not.toEqual('?');
});
+ it('generates file element with no permissions when permissions are explicitly none', function() {
+ var fileData = {
+ type: 'dir',
+ name: 'testFolder',
+ permissions: OC.PERMISSION_NONE
+ };
+ var $tr = fileList.add(fileData);
+ expect($tr.attr('data-permissions')).toEqual('0');
+ });
it('generates file element with zero size when size is explicitly zero', function() {
var fileData = {
type: 'dir',