Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
12d2b302
Commit
12d2b302
authored
Sep 05, 2014
by
Gergely Ujvari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unit test for string-helpers
parent
54d8d08b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
karma.config.js
karma.config.js
+1
-0
string-helpers-test.coffee
tests/js/helpers/string-helpers-test.coffee
+30
-0
No files found.
karma.config.js
View file @
12d2b302
...
...
@@ -41,6 +41,7 @@ module.exports = function(config) {
'h/static/scripts/vendor/moment-timezone-data.js'
,
'h/static/scripts/vendor/Markdown.Converter.js'
,
'h/static/scripts/vendor/sockjs-0.3.4.js'
,
'h/static/scripts/vendor/unorm.js'
,
'h/static/scripts/vendor/uuid.js'
,
'h/static/scripts/app.js'
,
'h/static/scripts/auth.js'
,
...
...
tests/js/helpers/string-helpers-test.coffee
0 → 100644
View file @
12d2b302
assert
=
chai
.
assert
sinon
.
assert
.
expose
(
assert
,
prefix
:
''
)
describe
'h.helpers.stringHelpers'
,
->
stringHelpers
=
null
beforeEach
module
(
'h.helpers.stringHelpers'
)
beforeEach
inject
(
_stringHelpers_
)
->
stringHelpers
=
_stringHelpers_
describe
'.unidecode'
,
->
it
'normalizes the input string'
,
->
text
=
'die Stra
\u
00DFe'
decoded
=
stringHelpers
.
unidecode
text
assert
.
equal
decoded
,
'die Straße'
it
'calls the right normalization'
,
->
unorm
.
nfc
=
sinon
.
stub
().
returns
(
''
)
stringHelpers
.
unidecode
''
,
'nfc'
sinon
.
assert
.
called
unorm
.
nfc
it
'removes combining characters'
,
->
text
=
'Fürge rőt róka túlszökik zsíros étkű kutyán'
decoded
=
stringHelpers
.
unidecode
text
expected
=
'Furge rot roka tulszokik zsiros etku kutyan'
assert
.
equal
decoded
,
expected
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