diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-07-02 16:38:20 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-07-02 16:38:20 +0200 |
commit | 71ae96bb56c668e8bc587e89ce9cf55e22fe7455 (patch) | |
tree | b275c7169c8b5178a6290af6ef83f008cd2b8d44 /apps/files_sharing/tests/js/shareSpec.js | |
parent | 063071b58db926238e895105e13a116a5ceebddb (diff) | |
download | nextcloud-server-71ae96bb56c668e8bc587e89ce9cf55e22fe7455.tar.gz nextcloud-server-71ae96bb56c668e8bc587e89ce9cf55e22fe7455.zip |
Do not show static share owner if not available
In some corner cases, an outgoing share exists but sharing is not
allowed for the current user. This would cause the file list to break
because the static text could not be rendered as the owner was
undefined.
Diffstat (limited to 'apps/files_sharing/tests/js/shareSpec.js')
-rw-r--r-- | apps/files_sharing/tests/js/shareSpec.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/apps/files_sharing/tests/js/shareSpec.js b/apps/files_sharing/tests/js/shareSpec.js index 1b1e363b792..1bbf4ffca09 100644 --- a/apps/files_sharing/tests/js/shareSpec.js +++ b/apps/files_sharing/tests/js/shareSpec.js @@ -206,6 +206,23 @@ describe('OCA.Sharing.Util tests', function() { expect(OC.basename(getImageUrl($tr.find('.filename .thumbnail')))).toEqual('folder-shared.svg'); expect($action.find('img').length).toEqual(1); }); + it('do not show static share text when share exists but neither permission nor owner is available', function() { + var $action, $tr; + fileList.setFiles([{ + id: 1, + type: 'dir', + name: 'One', + path: '/subdir', + mimetype: 'text/plain', + size: 12, + permissions: OC.PERMISSION_CREATE, + etag: 'abc' + }]); + $tr = fileList.$el.find('tbody tr:first'); + expect($tr.find('.action-share').length).toEqual(0); + $action = $tr.find('.action-share-notification'); + expect($action.length).toEqual(0); + }); }); describe('Share action', function() { var showDropDownStub; |