summaryrefslogtreecommitdiffstats
path: root/apps/files/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-05-19 18:48:48 +0200
committerVincent Petry <pvince81@owncloud.com>2014-05-30 10:06:29 +0200
commit89ff2857fc713d4ff5a635d87aef1a213d30d8e9 (patch)
tree0febc9bd604d54ccef14d9719b52f6d5be1db6fd /apps/files/tests
parent8bdce6698cb6a9e71d7bab72e649b63cb9f60bd8 (diff)
downloadnextcloud-server-89ff2857fc713d4ff5a635d87aef1a213d30d8e9.tar.gz
nextcloud-server-89ff2857fc713d4ff5a635d87aef1a213d30d8e9.zip
Add unit tests for fileActionsReady
Diffstat (limited to 'apps/files/tests')
-rw-r--r--apps/files/tests/js/filelistSpec.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index a3dc5b255a1..3dd715254e4 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -753,6 +753,20 @@ describe('OCA.Files.FileList tests', function() {
fileList.setFiles(testFiles);
expect(handler.calledOnce).toEqual(true);
});
+ it('triggers "fileActionsReady" event after single add', function() {
+ var handler = sinon.stub();
+ fileList.setFiles(testFiles);
+ fileList.$fileList.on('fileActionsReady', handler);
+ fileList.add({name: 'test.txt'});
+ expect(handler.calledOnce).toEqual(true);
+ });
+ it('does not trigger "fileActionsReady" event after single add with silent argument', function() {
+ var handler = sinon.stub();
+ fileList.setFiles(testFiles);
+ fileList.$fileList.on('fileActionsReady', handler);
+ fileList.add({name: 'test.txt'}, {silent: true});
+ expect(handler.notCalled).toEqual(true);
+ });
it('triggers "updated" event after update', function() {
var handler = sinon.stub();
fileList.$fileList.on('updated', handler);