summaryrefslogtreecommitdiff
path: root/spec/javascripts/lib/utils/text_utility_spec.js
diff options
context:
space:
mode:
authorJose Ivan Vargas <jvargas@gitlab.com>2017-04-03 10:37:08 -0500
committerJose Ivan Vargas <jvargas@gitlab.com>2017-04-03 11:31:30 -0500
commit3069a2c959fcdf05b95a5c0893d4c31e10950a01 (patch)
treee4f33b87ed51a3b4808127fe4760d00d9fd75725 /spec/javascripts/lib/utils/text_utility_spec.js
parentd745876e23e48e7fdf1b569c7e10dd4e2ca2734a (diff)
downloadgitlab-ce-environment-performance-improvements.tar.gz
Removed formatRelevantDigits from text_utils.js and added it to a new file number_utils.jsenvironment-performance-improvements
Also improved code formatting
Diffstat (limited to 'spec/javascripts/lib/utils/text_utility_spec.js')
-rw-r--r--spec/javascripts/lib/utils/text_utility_spec.js26
1 files changed, 0 insertions, 26 deletions
diff --git a/spec/javascripts/lib/utils/text_utility_spec.js b/spec/javascripts/lib/utils/text_utility_spec.js
index 3d0e92ed240..4200e943121 100644
--- a/spec/javascripts/lib/utils/text_utility_spec.js
+++ b/spec/javascripts/lib/utils/text_utility_spec.js
@@ -105,32 +105,6 @@ require('~/lib/utils/text_utility');
expect(textArea.value).toEqual(`${initialValue}* `);
});
});
-
- describe('gl.text.formatRelevantDigits', () => {
- it('returns 0 when the number is NaN', () => {
- expect(gl.text.formatRelevantDigits('fail')).toBe(0);
- });
-
- it('returns 4 decimals when there is 4 plus digits to the left', () => {
- const formattedNumber = gl.text.formatRelevantDigits('1000.1234567').split('.')[1];
- expect(formattedNumber.length).toBe(4);
- });
-
- it('returns 3 decimals when there is 1 digit to the left', () => {
- const formattedNumber = gl.text.formatRelevantDigits('0.1234567').split('.')[1];
- expect(formattedNumber.length).toBe(3);
- });
-
- it('returns 2 decimals when there is 2 digits to the left', () => {
- const formattedNumber = gl.text.formatRelevantDigits('10.1234567').split('.')[1];
- expect(formattedNumber.length).toBe(2);
- });
-
- it('returns 1 decimal when there is 3 digits to the left', () => {
- const formattedNumber = gl.text.formatRelevantDigits('100.1234567').split('.')[1];
- expect(formattedNumber.length).toBe(1);
- });
- });
});
});
})();