summaryrefslogtreecommitdiffstats
path: root/core/js/tests
diff options
context:
space:
mode:
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]);
+ }
+ });
});
});
});