summaryrefslogtreecommitdiffstats
path: root/apps/files/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-07-09 12:26:33 +0200
committerVincent Petry <pvince81@owncloud.com>2014-07-09 12:26:33 +0200
commit22653e21a239afa8f29cf2c93afe28d21246e7ba (patch)
treecacee44aabacafe6ce35ce82a4e62afa7cdaab1e /apps/files/tests
parent63fdaacbfcc8dbccca6777d623b6baadbd0ed56b (diff)
downloadnextcloud-server-22653e21a239afa8f29cf2c93afe28d21246e7ba.tar.gz
nextcloud-server-22653e21a239afa8f29cf2c93afe28d21246e7ba.zip
Propagate file action changes to the file lists
Whenever an app needs to register an event late, it does that on the original file actions object. Since the file actions that the file list work on is a merged list, not the original one, the registration event needs to be propagated there as well.
Diffstat (limited to 'apps/files/tests')
-rw-r--r--apps/files/tests/js/appSpec.js4
-rw-r--r--apps/files/tests/js/fileactionsSpec.js6
2 files changed, 4 insertions, 6 deletions
diff --git a/apps/files/tests/js/appSpec.js b/apps/files/tests/js/appSpec.js
index 99a73d0b01d..77d36d59fa9 100644
--- a/apps/files/tests/js/appSpec.js
+++ b/apps/files/tests/js/appSpec.js
@@ -52,9 +52,7 @@ describe('OCA.Files.App tests', function() {
App.initialize();
});
afterEach(function() {
- App.navigation = null;
- App.fileList = null;
- App.files = null;
+ App.destroy();
pushStateStub.restore();
parseUrlQueryStub.restore();
diff --git a/apps/files/tests/js/fileactionsSpec.js b/apps/files/tests/js/fileactionsSpec.js
index f087239de9d..f5f18a45a75 100644
--- a/apps/files/tests/js/fileactionsSpec.js
+++ b/apps/files/tests/js/fileactionsSpec.js
@@ -354,7 +354,7 @@ describe('OCA.Files.FileActions tests', function() {
it('notifies update event handlers once after multiple changes', function() {
var actionStub = sinon.stub();
var handler = sinon.stub();
- FileActions.addUpdateListener(handler);
+ FileActions.on('registerAction', handler);
FileActions.register(
'all',
'Test',
@@ -374,8 +374,8 @@ describe('OCA.Files.FileActions tests', function() {
it('does not notifies update event handlers after unregistering', function() {
var actionStub = sinon.stub();
var handler = sinon.stub();
- FileActions.addUpdateListener(handler);
- FileActions.removeUpdateListener(handler);
+ FileActions.on('registerAction', handler);
+ FileActions.off('registerAction', handler);
FileActions.register(
'all',
'Test',