diff options
author | Robin Appelman <robin@icewind.nl> | 2014-12-12 11:43:31 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2014-12-12 11:43:31 +0100 |
commit | 3bf0922b1337115c7cfc8a03547bc2d7d0d9fa69 (patch) | |
tree | 5c594dff36a1210b12dbb05558f50310819a5325 /apps/files_sharing/tests | |
parent | c451d99daae86290281806d0e8cdcfcfcf451412 (diff) | |
parent | bf887eca8bac04cbbd2f1bd5197017c0e0583edd (diff) | |
download | nextcloud-server-3bf0922b1337115c7cfc8a03547bc2d7d0d9fa69.tar.gz nextcloud-server-3bf0922b1337115c7cfc8a03547bc2d7d0d9fa69.zip |
Merge pull request #12527 from owncloud/js-pluginsystem
Simple Plugin system for Javascript
Diffstat (limited to 'apps/files_sharing/tests')
-rw-r--r-- | apps/files_sharing/tests/js/shareSpec.js | 8 | ||||
-rw-r--r-- | apps/files_sharing/tests/js/sharedfilelistSpec.js | 20 |
2 files changed, 7 insertions, 21 deletions
diff --git a/apps/files_sharing/tests/js/shareSpec.js b/apps/files_sharing/tests/js/shareSpec.js index 2cf5dc47b63..33c9c83b970 100644 --- a/apps/files_sharing/tests/js/shareSpec.js +++ b/apps/files_sharing/tests/js/shareSpec.js @@ -9,7 +9,6 @@ */ describe('OCA.Sharing.Util tests', function() { - var oldFileListPrototype; var fileList; var testFiles; @@ -24,10 +23,6 @@ describe('OCA.Sharing.Util tests', function() { } beforeEach(function() { - // back up prototype, as it will be extended by - // the sharing code - oldFileListPrototype = _.extend({}, OCA.Files.FileList.prototype); - var $content = $('<div id="content"></div>'); $('#testArea').append($content); // dummy file list @@ -41,12 +36,12 @@ describe('OCA.Sharing.Util tests', function() { $('#content').append($div); var fileActions = new OCA.Files.FileActions(); - OCA.Sharing.Util.initialize(fileActions); fileList = new OCA.Files.FileList( $div, { fileActions : fileActions } ); + OCA.Sharing.Util.attach(fileList); testFiles = [{ id: 1, @@ -67,7 +62,6 @@ describe('OCA.Sharing.Util tests', function() { }; }); afterEach(function() { - OCA.Files.FileList.prototype = oldFileListPrototype; delete OCA.Sharing.sharesLoaded; delete OC.Share.droppedDown; fileList.destroy(); diff --git a/apps/files_sharing/tests/js/sharedfilelistSpec.js b/apps/files_sharing/tests/js/sharedfilelistSpec.js index dc6931af6e8..7fdc6345e38 100644 --- a/apps/files_sharing/tests/js/sharedfilelistSpec.js +++ b/apps/files_sharing/tests/js/sharedfilelistSpec.js @@ -9,8 +9,7 @@ */ describe('OCA.Sharing.FileList tests', function() { - var testFiles, alertStub, notificationStub, fileList, fileActions; - var oldFileListPrototype; + var testFiles, alertStub, notificationStub, fileList; beforeEach(function() { alertStub = sinon.stub(OC.dialogs, 'alert'); @@ -46,18 +45,11 @@ describe('OCA.Sharing.FileList tests', function() { '<div id="emptycontent">Empty content message</div>' + '</div>' ); - // back up prototype, as it will be extended by - // the sharing code - oldFileListPrototype = _.extend({}, OCA.Files.FileList.prototype); - fileActions = new OCA.Files.FileActions(); - OCA.Sharing.Util.initialize(fileActions); }); afterEach(function() { - OCA.Files.FileList.prototype = oldFileListPrototype; testFiles = undefined; fileList.destroy(); fileList = undefined; - fileActions = undefined; notificationStub.restore(); alertStub.restore(); @@ -72,6 +64,7 @@ describe('OCA.Sharing.FileList tests', function() { sharedWithUser: true } ); + OCA.Sharing.Util.attach(fileList); fileList.reload(); @@ -193,6 +186,7 @@ describe('OCA.Sharing.FileList tests', function() { sharedWithUser: false } ); + OCA.Sharing.Util.attach(fileList); fileList.reload(); @@ -433,6 +427,7 @@ describe('OCA.Sharing.FileList tests', function() { linksOnly: true } ); + OCA.Sharing.Util.attach(fileList); fileList.reload(); @@ -575,11 +570,8 @@ describe('OCA.Sharing.FileList tests', function() { '</div>'); $('#content').append($div); - fileList = new OCA.Files.FileList( - $div, { - fileActions: fileActions - } - ); + fileList = new OCA.Files.FileList($div); + OCA.Sharing.Util.attach(fileList); }); it('external storage root folder', function () { |