aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-05-21 12:54:34 +0200
committerVincent Petry <pvince81@owncloud.com>2014-05-30 10:06:29 +0200
commit1d9129eac35b49a4e8d0d642a68d7d634f31c905 (patch)
tree513bdd46bb2e557bbac678aff73d1766b8e3c9c6 /apps/files/tests
parent6fbf4d8548133dff4419e5e2e0c649f49e177669 (diff)
downloadnextcloud-server-1d9129eac35b49a4e8d0d642a68d7d634f31c905.tar.gz
nextcloud-server-1d9129eac35b49a4e8d0d642a68d7d634f31c905.zip
Sharing overview fixes and unit tests
- Fixed renaming and fileActionsReady event - Added unit tests for shares list - Fixed public page with defer - Fixed file actions in sharing overview - Fixed sharing counterpart list (10 entries max) - Fixed file path attribute to be used in download action - Fix sharing list headers - OC.Share icons now operate on fileList instance - Fix OC.Share.updateIcon when more than one list in DOM
Diffstat (limited to 'apps/files/tests')
-rw-r--r--apps/files/tests/js/fileactionsSpec.js29
-rw-r--r--apps/files/tests/js/filelistSpec.js2
2 files changed, 29 insertions, 2 deletions
diff --git a/apps/files/tests/js/fileactionsSpec.js b/apps/files/tests/js/fileactionsSpec.js
index fa634da08a2..490594a1773 100644
--- a/apps/files/tests/js/fileactionsSpec.js
+++ b/apps/files/tests/js/fileactionsSpec.js
@@ -104,7 +104,34 @@ describe('OCA.Files.FileActions tests', function() {
$tr.find('.action-download').click();
expect(redirectStub.calledOnce).toEqual(true);
- expect(redirectStub.getCall(0).args[0]).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=testName.txt');
+ expect(redirectStub.getCall(0).args[0]).toEqual(
+ OC.webroot +
+ '/index.php/apps/files/ajax/download.php' +
+ '?dir=%2Fsubdir&files=testName.txt');
+ redirectStub.restore();
+ });
+ it('takes the file\'s path into account when clicking download', function() {
+ var redirectStub = sinon.stub(OC, 'redirect');
+ var fileData = {
+ id: 18,
+ type: 'file',
+ name: 'testName.txt',
+ path: '/anotherpath/there',
+ mimetype: 'text/plain',
+ size: '1234',
+ etag: 'a01234c',
+ mtime: '123456'
+ };
+ var $tr = fileList.add(fileData);
+ FileActions.display($tr.find('td.filename'), true, fileList);
+
+ $tr.find('.action-download').click();
+
+ expect(redirectStub.calledOnce).toEqual(true);
+ expect(redirectStub.getCall(0).args[0]).toEqual(
+ OC.webroot + '/index.php/apps/files/ajax/download.php' +
+ '?dir=%2Fanotherpath%2Fthere&files=testName.txt'
+ );
redirectStub.restore();
});
it('deletes file when clicking delete', function() {
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index a197fd5722c..3e9950dfe19 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -483,7 +483,7 @@ describe('OCA.Files.FileList tests', function() {
var $input, request;
for (var i = 0; i < testFiles.length; i++) {
- fileList.add(testFiles[i]);
+ fileList.add(testFiles[i], {silent: true});
}
// trigger rename prompt