summaryrefslogtreecommitdiff
path: root/spec/javascripts/lib
diff options
context:
space:
mode:
authorClement Ho <ClemMakesApps@gmail.com>2017-11-10 17:41:04 -0600
committerClement Ho <ClemMakesApps@gmail.com>2017-11-10 17:41:04 -0600
commit74b87f02db2ebda0b2b16a60dd6759fe6e8de95a (patch)
tree7432d75b3f4fcd84f20fef7157164b900648cc0d /spec/javascripts/lib
parente4df83d0252c57f84e795d0d50d9a82b07898f44 (diff)
downloadgitlab-ce-74b87f02db2ebda0b2b16a60dd6759fe6e8de95a.tar.gz
Backport of add-epic-sidebar
Diffstat (limited to 'spec/javascripts/lib')
-rw-r--r--spec/javascripts/lib/utils/text_utility_spec.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/spec/javascripts/lib/utils/text_utility_spec.js b/spec/javascripts/lib/utils/text_utility_spec.js
index 829b3ef5735..f2e2ce79d27 100644
--- a/spec/javascripts/lib/utils/text_utility_spec.js
+++ b/spec/javascripts/lib/utils/text_utility_spec.js
@@ -1,4 +1,4 @@
-import { highCountTrim } from '~/lib/utils/text_utility';
+import * as textUtility from '~/lib/utils/text_utility';
describe('text_utility', () => {
describe('gl.text.getTextWidth', () => {
@@ -37,12 +37,18 @@ describe('text_utility', () => {
describe('highCountTrim', () => {
it('returns 99+ for count >= 100', () => {
- expect(highCountTrim(105)).toBe('99+');
- expect(highCountTrim(100)).toBe('99+');
+ expect(textUtility.highCountTrim(105)).toBe('99+');
+ expect(textUtility.highCountTrim(100)).toBe('99+');
});
it('returns exact number for count < 100', () => {
- expect(highCountTrim(45)).toBe(45);
+ expect(textUtility.highCountTrim(45)).toBe(45);
+ });
+ });
+
+ describe('capitalizeFirstCharacter', () => {
+ it('returns string with first letter capitalized', () => {
+ expect(textUtility.capitalizeFirstCharacter('gitlab')).toEqual('Gitlab');
});
});