summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-01-27 09:33:38 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-01-27 09:33:38 +0100
commit1add2f3f58d6695ad06cc9d77ea0bf04e74339f7 (patch)
treedca24acbb653167e96ccfcb9700289d0c20ae7ea /apps/files_sharing/tests
parent29f49ddc3de11fd133a114627d09867e003d30db (diff)
parentefcd89cb18ea9e553d1d7a52f35cd61b499cf184 (diff)
downloadnextcloud-server-1add2f3f58d6695ad06cc9d77ea0bf04e74339f7.tar.gz
nextcloud-server-1add2f3f58d6695ad06cc9d77ea0bf04e74339f7.zip
Merge pull request #13679 from owncloud/public-disablesharejsplugin
Disable JS plugin for sharing in public mode
Diffstat (limited to 'apps/files_sharing/tests')
-rw-r--r--apps/files_sharing/tests/js/shareSpec.js26
1 files changed, 25 insertions, 1 deletions
diff --git a/apps/files_sharing/tests/js/shareSpec.js b/apps/files_sharing/tests/js/shareSpec.js
index e5b5de314d7..1b1e363b792 100644
--- a/apps/files_sharing/tests/js/shareSpec.js
+++ b/apps/files_sharing/tests/js/shareSpec.js
@@ -27,7 +27,7 @@ describe('OCA.Sharing.Util tests', function() {
$('#testArea').append($content);
// dummy file list
var $div = $(
- '<div>' +
+ '<div id="listContainer">' +
'<table id="filestable">' +
'<thead></thead>' +
'<tbody id="fileList"></tbody>' +
@@ -450,5 +450,29 @@ describe('OCA.Sharing.Util tests', function() {
.toEqual('User four, User one, User three, User two, +6');
});
});
+ describe('Excluded lists', function() {
+ function createListThenAttach(listId) {
+ var fileActions = new OCA.Files.FileActions();
+ fileList.destroy();
+ fileList = new OCA.Files.FileList(
+ $('#listContainer'), {
+ id: listId,
+ fileActions: fileActions
+ }
+ );
+ OCA.Sharing.Util.attach(fileList);
+ fileList.setFiles(testFiles);
+ return fileList;
+ }
+
+ it('does not attach to trashbin or public file lists', function() {
+ createListThenAttach('trashbin');
+ expect($('.action-share').length).toEqual(0);
+ expect($('[data-share-recipient]').length).toEqual(0);
+ createListThenAttach('files.public');
+ expect($('.action-share').length).toEqual(0);
+ expect($('[data-share-recipient]').length).toEqual(0);
+ });
+ });
});