summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2019-06-05 15:14:02 +0100
committerFilipa Lacerda <filipa@gitlab.com>2019-06-05 15:14:02 +0100
commit74f78fa326a603be310375f9b37f8c8c9d921305 (patch)
tree6fc6ac3e4d1031372f35bbb3c649300409a84a4a /spec
parentc9da437599027e9f2ef9f78a5167237f4b2a54dd (diff)
downloadgitlab-ce-74f78fa326a603be310375f9b37f8c8c9d921305.tar.gz
Adds hashed option to bs linked options59232-add-storage-counter-ce
Adds isOdd function
Diffstat (limited to 'spec')
-rw-r--r--spec/frontend/lib/utils/number_utility_spec.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/frontend/lib/utils/number_utility_spec.js b/spec/frontend/lib/utils/number_utility_spec.js
index 818404bad81..77d7478d317 100644
--- a/spec/frontend/lib/utils/number_utility_spec.js
+++ b/spec/frontend/lib/utils/number_utility_spec.js
@@ -5,6 +5,7 @@ import {
bytesToGiB,
numberToHumanSize,
sum,
+ isOdd,
} from '~/lib/utils/number_utils';
describe('Number Utils', () => {
@@ -98,4 +99,14 @@ describe('Number Utils', () => {
expect([1, 2, 3, 4, 5].reduce(sum)).toEqual(15);
});
});
+
+ describe('isOdd', () => {
+ it('should return 0 with a even number', () => {
+ expect(isOdd(2)).toEqual(0);
+ });
+
+ it('should return 1 with a odd number', () => {
+ expect(isOdd(1)).toEqual(1);
+ });
+ });
});