BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
63c00e38
Commit
63c00e38
authored
Nov 28, 2017
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix text utility conflicts
parent
200e14e8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
21 deletions
+12
-21
text_utility.js
app/assets/javascripts/lib/utils/text_utility.js
+0
-3
text_utility_spec.js
spec/javascripts/lib/utils/text_utility_spec.js
+12
-18
No files found.
app/assets/javascripts/lib/utils/text_utility.js
View file @
63c00e38
...
...
@@ -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'
spec/javascripts/lib/utils/text_utility_spec.js
View file @
63c00e38
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+'
);
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment