summaryrefslogtreecommitdiff
path: root/spec/javascripts/lib/utils/number_utility_spec.js
diff options
context:
space:
mode:
authorKushal Pandya <kushalspandya@gmail.com>2017-05-29 15:04:47 +0000
committerFilipa Lacerda <filipa@gitlab.com>2017-05-29 15:04:47 +0000
commit069783b5ccda2eb89f9c953334e2e9a6b809066e (patch)
tree554538bc23cc2da9915e0b046c501c363d79b12a /spec/javascripts/lib/utils/number_utility_spec.js
parent437bb9282c90ac0ac8c3c87386b3220c33d2b4b4 (diff)
downloadgitlab-ce-069783b5ccda2eb89f9c953334e2e9a6b809066e.tar.gz
Add performance deltas between app deployments on Merge Request widget
Diffstat (limited to 'spec/javascripts/lib/utils/number_utility_spec.js')
-rw-r--r--spec/javascripts/lib/utils/number_utility_spec.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/javascripts/lib/utils/number_utility_spec.js b/spec/javascripts/lib/utils/number_utility_spec.js
index 90b12c9f115..83c92deccdc 100644
--- a/spec/javascripts/lib/utils/number_utility_spec.js
+++ b/spec/javascripts/lib/utils/number_utility_spec.js
@@ -1,4 +1,4 @@
-import { formatRelevantDigits, bytesToKiB } from '~/lib/utils/number_utils';
+import { formatRelevantDigits, bytesToKiB, bytesToMiB } from '~/lib/utils/number_utils';
describe('Number Utils', () => {
describe('formatRelevantDigits', () => {
@@ -45,4 +45,11 @@ describe('Number Utils', () => {
expect(bytesToKiB(1000)).toEqual(0.9765625);
});
});
+
+ describe('bytesToMiB', () => {
+ it('calculates MiB for the given bytes', () => {
+ expect(bytesToMiB(1048576)).toEqual(1);
+ expect(bytesToMiB(1000000)).toEqual(0.95367431640625);
+ });
+ });
});