Remove obsoleted filelist prototype backup in tests

remotes/origin/fix-10825
Vincent Petry 10 years ago
parent c02ef69521
commit bf887eca8b
  1. 6
      apps/files_external/tests/js/mountsfilelistSpec.js
  2. 6
      apps/files_sharing/tests/js/shareSpec.js
  3. 15
      apps/files_sharing/tests/js/sharedfilelistSpec.js

@ -9,8 +9,7 @@
*/ */
describe('OCA.External.FileList tests', function() { describe('OCA.External.FileList tests', function() {
var testFiles, alertStub, notificationStub, fileList, fileActions; var testFiles, alertStub, notificationStub, fileList;
var oldFileListPrototype;
beforeEach(function() { beforeEach(function() {
alertStub = sinon.stub(OC.dialogs, 'alert'); alertStub = sinon.stub(OC.dialogs, 'alert');
@ -49,14 +48,11 @@ describe('OCA.External.FileList tests', function() {
'<div id="emptycontent">Empty content message</div>' + '<div id="emptycontent">Empty content message</div>' +
'</div>' '</div>'
); );
fileActions = new OCA.Files.FileActions();
}); });
afterEach(function() { afterEach(function() {
OCA.Files.FileList.prototype = oldFileListPrototype;
testFiles = undefined; testFiles = undefined;
fileList.destroy(); fileList.destroy();
fileList = undefined; fileList = undefined;
fileActions = undefined;
notificationStub.restore(); notificationStub.restore();
alertStub.restore(); alertStub.restore();

@ -9,7 +9,6 @@
*/ */
describe('OCA.Sharing.Util tests', function() { describe('OCA.Sharing.Util tests', function() {
var oldFileListPrototype;
var fileList; var fileList;
var testFiles; var testFiles;
@ -24,10 +23,6 @@ describe('OCA.Sharing.Util tests', function() {
} }
beforeEach(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>'); var $content = $('<div id="content"></div>');
$('#testArea').append($content); $('#testArea').append($content);
// dummy file list // dummy file list
@ -67,7 +62,6 @@ describe('OCA.Sharing.Util tests', function() {
}; };
}); });
afterEach(function() { afterEach(function() {
OCA.Files.FileList.prototype = oldFileListPrototype;
delete OCA.Sharing.sharesLoaded; delete OCA.Sharing.sharesLoaded;
delete OC.Share.droppedDown; delete OC.Share.droppedDown;
fileList.destroy(); fileList.destroy();

@ -9,8 +9,7 @@
*/ */
describe('OCA.Sharing.FileList tests', function() { describe('OCA.Sharing.FileList tests', function() {
var testFiles, alertStub, notificationStub, fileList, fileActions; var testFiles, alertStub, notificationStub, fileList;
var oldFileListPrototype;
beforeEach(function() { beforeEach(function() {
alertStub = sinon.stub(OC.dialogs, 'alert'); alertStub = sinon.stub(OC.dialogs, 'alert');
@ -46,17 +45,11 @@ describe('OCA.Sharing.FileList tests', function() {
'<div id="emptycontent">Empty content message</div>' + '<div id="emptycontent">Empty content message</div>' +
'</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();
}); });
afterEach(function() { afterEach(function() {
OCA.Files.FileList.prototype = oldFileListPrototype;
testFiles = undefined; testFiles = undefined;
fileList.destroy(); fileList.destroy();
fileList = undefined; fileList = undefined;
fileActions = undefined;
notificationStub.restore(); notificationStub.restore();
alertStub.restore(); alertStub.restore();
@ -577,11 +570,7 @@ describe('OCA.Sharing.FileList tests', function() {
'</div>'); '</div>');
$('#content').append($div); $('#content').append($div);
fileList = new OCA.Files.FileList( fileList = new OCA.Files.FileList($div);
$div, {
fileActions: fileActions
}
);
OCA.Sharing.Util.attach(fileList); OCA.Sharing.Util.attach(fileList);
}); });

Loading…
Cancel
Save