mirror of
https://github.com/nextcloud/server.git
synced 2026-04-21 22:27:31 -04:00
Tentative fix for legacy file actions unit test side effect
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.
This commit is contained in:
parent
1978d3d6a2
commit
05cf940983
2 changed files with 14 additions and 0 deletions
|
|
@ -23,6 +23,7 @@ describe('OCA.Files.App tests', function() {
|
|||
var App = OCA.Files.App;
|
||||
var pushStateStub;
|
||||
var parseUrlQueryStub;
|
||||
var oldLegacyFileActions;
|
||||
|
||||
beforeEach(function() {
|
||||
$('#testArea').append(
|
||||
|
|
@ -41,6 +42,7 @@ describe('OCA.Files.App tests', function() {
|
|||
'</div>'
|
||||
);
|
||||
|
||||
oldLegacyFileActions = window.FileActions;
|
||||
window.FileActions = new OCA.Files.FileActions();
|
||||
OCA.Files.legacyFileActions = window.FileActions;
|
||||
OCA.Files.fileActions = new OCA.Files.FileActions();
|
||||
|
|
@ -54,6 +56,8 @@ describe('OCA.Files.App tests', function() {
|
|||
afterEach(function() {
|
||||
App.destroy();
|
||||
|
||||
window.FileActions = oldLegacyFileActions;
|
||||
|
||||
pushStateStub.restore();
|
||||
parseUrlQueryStub.restore();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -57,6 +57,16 @@ describe('OCA.Sharing.App tests', function() {
|
|||
});
|
||||
});
|
||||
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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue