diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-03-27 14:18:47 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-03-27 14:18:47 +0100 |
commit | 0ecc1c89ad77341c3d178fe4d393b3207849fb60 (patch) | |
tree | 85a3d0aa2a3d6b182d2139dcb556e0676cc69b67 /apps/files/tests/js/filesummarySpec.js | |
parent | 4d57b7bb3ccee1955e478406f1685efa3034a2f4 (diff) | |
parent | 2b0906cdffb69db3651b42f7cee2e67c7d095475 (diff) | |
download | nextcloud-server-0ecc1c89ad77341c3d178fe4d393b3207849fb60.tar.gz nextcloud-server-0ecc1c89ad77341c3d178fe4d393b3207849fb60.zip |
Merge pull request #15254 from owncloud/fix-14853-master
Adding a pending indicator to the files summary
Diffstat (limited to 'apps/files/tests/js/filesummarySpec.js')
-rw-r--r-- | apps/files/tests/js/filesummarySpec.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/apps/files/tests/js/filesummarySpec.js b/apps/files/tests/js/filesummarySpec.js index 4c53b7d8b3a..ae5ff95fc0c 100644 --- a/apps/files/tests/js/filesummarySpec.js +++ b/apps/files/tests/js/filesummarySpec.js @@ -148,4 +148,37 @@ describe('OCA.Files.FileSummary tests', function() { expect(s.summary.totalFiles).toEqual(1); expect(s.summary.totalSize).toEqual(127903); }); + it('properly sum up pending folder sizes after adding', function() { + var s = new FileSummary($container); + s.setSummary({ + totalDirs: 0, + totalFiles: 0, + totalSize: 0 + }); + s.add({type: 'dir', size: -1}); + s.update(); + expect($container.hasClass('hidden')).toEqual(false); + expect($container.find('.info').text()).toEqual('1 folder and 0 files'); + expect($container.find('.filesize').text()).toEqual('Pending'); + expect(s.summary.totalDirs).toEqual(1); + expect(s.summary.totalFiles).toEqual(0); + expect(s.summary.totalSize).toEqual(0); + }); + it('properly sum up pending folder sizes after remove', function() { + var s = new FileSummary($container); + s.setSummary({ + totalDirs: 0, + totalFiles: 0, + totalSize: 0 + }); + s.add({type: 'dir', size: -1}); + s.remove({type: 'dir', size: -1}); + s.update(); + expect($container.hasClass('hidden')).toEqual(true); + expect($container.find('.info').text()).toEqual('0 folders and 0 files'); + expect($container.find('.filesize').text()).toEqual('0 B'); + expect(s.summary.totalDirs).toEqual(0); + expect(s.summary.totalFiles).toEqual(0); + expect(s.summary.totalSize).toEqual(0); + }); }); |