summaryrefslogtreecommitdiffstats
path: root/apps/files/tests/js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-09-21 18:49:15 +0200
committerMorris Jobke <hey@morrisjobke.de>2016-10-25 14:51:44 +0200
commit50b8221255c7fe88a1968419904ff295c4db9613 (patch)
tree3549c46666e332ecae5a1aad3996caccb8c2f08a /apps/files/tests/js
parent89574367bcc57da5eda6d13ffcfd8a12de68ea26 (diff)
downloadnextcloud-server-50b8221255c7fe88a1968419904ff295c4db9613.tar.gz
nextcloud-server-50b8221255c7fe88a1968419904ff295c4db9613.zip
Highlight files and update storage stats at end of upload (#26164)
Properly trigger the "stop" even from the uploader. Also update storage stats at the end of all uploads instead of for each upload.
Diffstat (limited to 'apps/files/tests/js')
-rw-r--r--apps/files/tests/js/filelistSpec.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index 3b0e0b83b82..15dab3b9882 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -2794,13 +2794,22 @@ describe('OCA.Files.FileList tests', function() {
highlightStub.restore();
});
- it('queries storage stats', function() {
+ it('queries storage stats after all fetches are done', function() {
var statStub = sinon.stub(fileList, 'updateStorageStatistics');
- addFile(createUpload('upload.txt', '/subdir'));
- expect(statStub.notCalled).toEqual(true);
+ var highlightStub = sinon.stub(fileList, 'highlightFiles');
+ var def1 = addFile(createUpload('upload.txt', '/subdir'));
+ var def2 = addFile(createUpload('upload2.txt', '/subdir'));
+ var def3 = addFile(createUpload('upload3.txt', '/another'));
uploader.trigger('stop', {});
+
+ expect(statStub.notCalled).toEqual(true);
+ def1.resolve();
+ expect(statStub.notCalled).toEqual(true);
+ def2.resolve();
+ def3.resolve();
expect(statStub.calledOnce).toEqual(true);
- statStub.restore();
+
+ highlightStub.restore();
});
});
});