Sometimes the JS unit test with legacy file actions fail.
This fix runs the legacy file actions tests on a dummy instead of the
real one.
var App = OCA.Files.App;
var pushStateStub;
var parseUrlQueryStub;
+ var oldLegacyFileActions;
beforeEach(function() {
$('#testArea').append(
'</div>'
);
+ oldLegacyFileActions = window.FileActions;
window.FileActions = new OCA.Files.FileActions();
OCA.Files.legacyFileActions = window.FileActions;
OCA.Files.fileActions = new OCA.Files.FileActions();
afterEach(function() {
App.destroy();
+ window.FileActions = oldLegacyFileActions;
+
pushStateStub.restore();
parseUrlQueryStub.restore();
});
});
});
describe('file actions', function() {
+ var oldLegacyFileActions;
+
+ beforeEach(function() {
+ oldLegacyFileActions = window.FileActions;
+ window.FileActions = new OCA.Files.FileActions();
+ });
+
+ afterEach(function() {
+ window.FileActions = oldLegacyFileActions;
+ });
it('provides default file actions', function() {
_.each([fileListIn, fileListOut], function(fileList) {
var fileActions = fileList.fileActions;