summaryrefslogtreecommitdiffstats
path: root/core/js/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-06-02 17:37:53 +0200
committerMorris Jobke <hey@morrisjobke.de>2014-06-02 17:37:53 +0200
commitdd8b7b7af892f16926d0b64bffa59cf616076144 (patch)
treecc5c300749dcac85a01ae3f6ae89ef902958ca3c /core/js/tests
parent51602f67e002dc23342fd7c13d803a98b732e812 (diff)
parent5d457dafc1d8a2aafb0d630a7f8a5b56cef7d97b (diff)
downloadnextcloud-server-dd8b7b7af892f16926d0b64bffa59cf616076144.tar.gz
nextcloud-server-dd8b7b7af892f16926d0b64bffa59cf616076144.zip
Merge pull request #8613 from owncloud/filesize-alignment
Improve aligment of file size
Diffstat (limited to 'core/js/tests')
-rw-r--r--core/js/tests/specs/coreSpec.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/js/tests/specs/coreSpec.js b/core/js/tests/specs/coreSpec.js
index 233c4d5a0b4..47e5ebfed55 100644
--- a/core/js/tests/specs/coreSpec.js
+++ b/core/js/tests/specs/coreSpec.js
@@ -500,6 +500,19 @@ describe('Core base tests', function() {
expect(OC.Util.humanFileSize(data[i][0])).toEqual(data[i][1]);
}
});
+ it('renders file sizes with the correct unit for small sizes', function() {
+ var data = [
+ [0, '0 kB'],
+ [125, '< 1 kB'],
+ [128000, '125 kB'],
+ [128000000, '122.1 MB'],
+ [128000000000, '119.2 GB'],
+ [128000000000000, '116.4 TB']
+ ];
+ for (var i = 0; i < data.length; i++) {
+ expect(OC.Util.humanFileSize(data[i][0], true)).toEqual(data[i][1]);
+ }
+ });
});
});
});