aboutsummaryrefslogtreecommitdiffstats
path: root/core/js/tests/specs/coreSpec.js
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-02-28 00:27:51 -0600
committerGitHub <noreply@github.com>2017-02-28 00:27:51 -0600
commit413d671d9e9d8928c062dac4b993db12a618c590 (patch)
tree2d38120e7b40c630c2030a05c2d885c298de5d54 /core/js/tests/specs/coreSpec.js
parent7fc3129f0cb80358c5b8f5c2b93f0aa446d1c317 (diff)
parent9790fe7f5d349df4f56c427cf3559d004067eae5 (diff)
downloadnextcloud-server-413d671d9e9d8928c062dac4b993db12a618c590.tar.gz
nextcloud-server-413d671d9e9d8928c062dac4b993db12a618c590.zip
Merge pull request #3635 from individual-it/fix_quota_validation
better quota validation
Diffstat (limited to 'core/js/tests/specs/coreSpec.js')
-rw-r--r--core/js/tests/specs/coreSpec.js24
1 files changed, 22 insertions, 2 deletions
diff --git a/core/js/tests/specs/coreSpec.js b/core/js/tests/specs/coreSpec.js
index 3380b6be420..dd13cba8e2b 100644
--- a/core/js/tests/specs/coreSpec.js
+++ b/core/js/tests/specs/coreSpec.js
@@ -594,8 +594,14 @@ describe('Core base tests', function() {
it('correctly parses file sizes from a human readable formated string', function() {
var data = [
['125', 125],
- ['125.25', 125.25],
+ ['125.25', 125],
+ ['125.25B', 125],
+ ['125.25 B', 125],
['0 B', 0],
+ ['99999999999999999999999999999999999999999999 B', 99999999999999999999999999999999999999999999],
+ ['0 MB', 0],
+ ['0 kB', 0],
+ ['0kB', 0],
['125 B', 125],
['125b', 125],
['125 KB', 128000],
@@ -605,7 +611,21 @@ describe('Core base tests', function() {
['119.2 GB', 127990025421],
['119.2gb', 127990025421],
['116.4 TB', 127983153473126],
- ['116.4tb', 127983153473126]
+ ['116.4tb', 127983153473126],
+ ['8776656778888777655.4tb', 9.650036181387265e+30],
+ [1234, null],
+ [-1234, null],
+ ['-1234 B', null],
+ ['B', null],
+ ['40/0', null],
+ ['40,30 kb', null],
+ [' 122.1 MB ', 128031130],
+ ['122.1 MB ', 128031130],
+ [' 122.1 MB ', 128031130],
+ [' 122.1 MB ', 128031130],
+ ['122.1 MB ', 128031130],
+ [' 125', 125],
+ [' 125 ', 125],
];
for (var i = 0; i < data.length; i++) {
expect(OC.Util.computerFileSize(data[i][0])).toEqual(data[i][1]);