diff options
author | Julius Härtl <jus@bitgrid.net> | 2019-10-14 19:19:16 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2019-10-14 19:19:16 +0200 |
commit | 5e4eda1ae0ea0ee7e690fee1017dae873a1a7512 (patch) | |
tree | 82da6da8c61c74922451ff23e93f8b398cb1cbc6 /apps/files/tests/js/appSpec.js | |
parent | b076e3a17da1bb3f418af366f78e397fe3cc9b79 (diff) | |
download | nextcloud-server-5e4eda1ae0ea0ee7e690fee1017dae873a1a7512.tar.gz nextcloud-server-5e4eda1ae0ea0ee7e690fee1017dae873a1a7512.zip |
Remove deprecated legacy file actions
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/files/tests/js/appSpec.js')
-rw-r--r-- | apps/files/tests/js/appSpec.js | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/apps/files/tests/js/appSpec.js b/apps/files/tests/js/appSpec.js index 15297a029d4..62e3ac2868a 100644 --- a/apps/files/tests/js/appSpec.js +++ b/apps/files/tests/js/appSpec.js @@ -24,7 +24,6 @@ describe('OCA.Files.App tests', function() { var pushStateStub; var replaceStateStub; var parseUrlQueryStub; - var oldLegacyFileActions; beforeEach(function() { $('#testArea').append( @@ -43,9 +42,6 @@ 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(); pushStateStub = sinon.stub(OC.Util.History, 'pushState'); @@ -58,8 +54,6 @@ describe('OCA.Files.App tests', function() { afterEach(function() { App.destroy(); - window.FileActions = oldLegacyFileActions; - pushStateStub.restore(); replaceStateStub.restore(); parseUrlQueryStub.restore(); @@ -71,66 +65,6 @@ describe('OCA.Files.App tests', function() { expect(App.fileList.fileActions.actions.all).toBeDefined(); expect(App.fileList.$el.is('#app-content-files')).toEqual(true); }); - it('merges the legacy file actions with the default ones', function() { - var legacyActionStub = sinon.stub(); - var actionStub = sinon.stub(); - // legacy action - window.FileActions.register( - 'all', - 'LegacyTest', - OC.PERMISSION_READ, - OC.imagePath('core', 'actions/test'), - legacyActionStub - ); - // legacy action to be overwritten - window.FileActions.register( - 'all', - 'OverwriteThis', - OC.PERMISSION_READ, - OC.imagePath('core', 'actions/test'), - legacyActionStub - ); - - // regular file actions - OCA.Files.fileActions.register( - 'all', - 'RegularTest', - OC.PERMISSION_READ, - OC.imagePath('core', 'actions/test'), - actionStub - ); - - // overwrite - OCA.Files.fileActions.register( - 'all', - 'OverwriteThis', - OC.PERMISSION_READ, - OC.imagePath('core', 'actions/test'), - actionStub - ); - - App.initialize(); - - var actions = App.fileList.fileActions.actions; - var context = { fileActions: sinon.createStubInstance(OCA.Files.FileActions) }; - actions.all.OverwriteThis.action('testFileName', context); - expect(actionStub.calledOnce).toBe(true); - expect(context.fileActions._notifyUpdateListeners.callCount).toBe(2); - expect(context.fileActions._notifyUpdateListeners.getCall(0).calledWith('beforeTriggerAction')).toBe(true); - expect(context.fileActions._notifyUpdateListeners.getCall(1).calledWith('afterTriggerAction')).toBe(true); - actions.all.LegacyTest.action('testFileName', context); - expect(legacyActionStub.calledOnce).toBe(true); - expect(context.fileActions._notifyUpdateListeners.callCount).toBe(4); - expect(context.fileActions._notifyUpdateListeners.getCall(2).calledWith('beforeTriggerAction')).toBe(true); - expect(context.fileActions._notifyUpdateListeners.getCall(3).calledWith('afterTriggerAction')).toBe(true); - actions.all.RegularTest.action('testFileName', context); - expect(actionStub.calledTwice).toBe(true); - expect(context.fileActions._notifyUpdateListeners.callCount).toBe(6); - expect(context.fileActions._notifyUpdateListeners.getCall(4).calledWith('beforeTriggerAction')).toBe(true); - expect(context.fileActions._notifyUpdateListeners.getCall(5).calledWith('afterTriggerAction')).toBe(true); - // default one still there - expect(actions.dir.Open.action).toBeDefined(); - }); }); describe('URL handling', function() { |