summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClement Ho <ClemMakesApps@gmail.com>2017-11-28 09:14:46 -0600
committerClement Ho <ClemMakesApps@gmail.com>2017-11-28 09:14:46 -0600
commit63c00e380a69aa86c06b99cc97f1046c50a0c5ec (patch)
treeebb1cf898f311d1a03d2a8a3310c224c1e6d98ae
parent200e14e853fbcf2333667cd122c8afb4dcdd612e (diff)
downloadgitlab-ce-63c00e380a69aa86c06b99cc97f1046c50a0c5ec.tar.gz
Fix text utility conflicts
-rw-r--r--app/assets/javascripts/lib/utils/text_utility.js3
-rw-r--r--spec/javascripts/lib/utils/text_utility_spec.js30
2 files changed, 12 insertions, 21 deletions
diff --git a/app/assets/javascripts/lib/utils/text_utility.js b/app/assets/javascripts/lib/utils/text_utility.js
index a048e965570..d070dd1e7c3 100644
--- a/app/assets/javascripts/lib/utils/text_utility.js
+++ b/app/assets/javascripts/lib/utils/text_utility.js
@@ -156,7 +156,6 @@ gl.text.moveCursor = function(textArea, tag, wrapped, removedLastNewLine) {
pos -= 1;
}
-<<<<<<< HEAD
return textArea.setSelectionRange(pos, pos);
}
};
@@ -196,7 +195,6 @@ gl.text.dasherize = function(str) {
gl.text.slugify = function(str) {
return str.trim().toLowerCase().latinise();
};
-=======
/**
* Capitalizes first character
*
@@ -206,4 +204,3 @@ gl.text.slugify = function(str) {
export function capitalizeFirstCharacter(text) {
return `${text[0].toUpperCase()}${text.slice(1)}`;
}
->>>>>>> f8de23e626... Merge branch 'backport-add-epic-sidebar' into 'master'
diff --git a/spec/javascripts/lib/utils/text_utility_spec.js b/spec/javascripts/lib/utils/text_utility_spec.js
index b9b0ddf2a83..d8415f8ba6a 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 textUtils from '~/lib/utils/text_utility';
describe('text_utility', () => {
describe('gl.text.getTextWidth', () => {
@@ -21,23 +21,9 @@ describe('text_utility', () => {
});
});
-<<<<<<< HEAD
describe('gl.text.pluralize', () => {
it('returns pluralized', () => {
expect(gl.text.pluralize('test', 2)).toBe('tests');
-=======
- describe('capitalizeFirstCharacter', () => {
- it('returns string with first letter capitalized', () => {
- expect(textUtils.capitalizeFirstCharacter('gitlab')).toEqual('Gitlab');
- expect(textUtils.highCountTrim(105)).toBe('99+');
- expect(textUtils.highCountTrim(100)).toBe('99+');
- });
- });
-
- describe('humanize', () => {
- it('should remove underscores and uppercase the first letter', () => {
- expect(textUtils.humanize('foo_bar')).toEqual('Foo bar');
->>>>>>> f8de23e626... Merge branch 'backport-add-epic-sidebar' into 'master'
});
it('returns pluralized when count is 0', () => {
@@ -51,12 +37,20 @@ describe('text_utility', () => {
describe('highCountTrim', () => {
it('returns 99+ for count >= 100', () => {
- expect(highCountTrim(105)).toBe('99+');
- expect(highCountTrim(100)).toBe('99+');
+ expect(textUtils.highCountTrim(105)).toBe('99+');
+ expect(textUtils.highCountTrim(100)).toBe('99+');
});
it('returns exact number for count < 100', () => {
- expect(highCountTrim(45)).toBe(45);
+ expect(textUtils.highCountTrim(45)).toBe(45);
+ });
+ });
+
+ describe('capitalizeFirstCharacter', () => {
+ it('returns string with first letter capitalized', () => {
+ expect(textUtils.capitalizeFirstCharacter('gitlab')).toEqual('Gitlab');
+ expect(textUtils.highCountTrim(105)).toBe('99+');
+ expect(textUtils.highCountTrim(100)).toBe('99+');
});
});