Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
enedis_sge_konnector
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
Factory
LLLE_Project
enedis_sge_konnector
Commits
dd7141f8
Commit
dd7141f8
authored
2 years ago
by
Hugo SUBTIL
Browse files
Options
Downloads
Patches
Plain Diff
feat: update TU
parent
c866549f
No related branches found
Branches containing commit
No related tags found
1 merge request
!21
US878 feat(rechercherpoint): add two fallback in case of no rechercher point match
Pipeline
#43434
passed
2 years ago
Stage: test
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
__tests__/helpers/parsing.spec.js
+33
-0
33 additions, 0 deletions
__tests__/helpers/parsing.spec.js
src/helpers/parsing.js
+2
-2
2 additions, 2 deletions
src/helpers/parsing.js
with
35 additions
and
2 deletions
__tests__/helpers/parsing.spec.js
+
33
−
0
View file @
dd7141f8
...
...
@@ -9,6 +9,8 @@ const {
formateDataForDoctype
,
parseTags
,
parseValue
,
removeMultipleSpaces
,
removeAddressnumber
,
}
=
require
(
'
../../src/helpers/parsing
'
)
describe
(
'
parsing
'
,
()
=>
{
it
(
'
should parse userPdl
'
,
()
=>
{
...
...
@@ -189,4 +191,35 @@ describe('parsing', () => {
const
reply
=
parseValue
(
14361
,
'
w
'
)
expect
(
reply
).
toBe
(
14361
)
})
it
(
'
should remove spaces ✅
'
,
()
=>
{
const
reply
=
removeMultipleSpaces
(
'
20 rue du lac
'
)
expect
(
reply
).
toBe
(
'
20 rue du lac
'
)
})
describe
(
'
removeAddressnumber
'
,
()
=>
{
it
(
'
should remove address number ✅
'
,
()
=>
{
const
reply
=
removeAddressnumber
(
'
20 rue du lac
'
)
expect
(
reply
).
toBe
(
'
rue du lac
'
)
})
it
(
'
should remove B and number ✅
'
,
()
=>
{
const
reply
=
removeAddressnumber
(
'
20 B rue du lac
'
)
expect
(
reply
).
toBe
(
'
rue du lac
'
)
})
it
(
'
should remove b and number ✅
'
,
()
=>
{
const
reply
=
removeAddressnumber
(
'
20 B rue du lac
'
)
expect
(
reply
).
toBe
(
'
rue du lac
'
)
})
it
(
'
should remove T and number ✅
'
,
()
=>
{
const
reply
=
removeAddressnumber
(
'
20 T rue du lac
'
)
expect
(
reply
).
toBe
(
'
rue du lac
'
)
})
it
(
'
should remove t and number ✅
'
,
()
=>
{
const
reply
=
removeAddressnumber
(
'
20 t rue du lac
'
)
expect
(
reply
).
toBe
(
'
rue du lac
'
)
})
it
(
'
should remove t and number ✅
'
,
()
=>
{
const
reply
=
removeAddressnumber
(
'
20t rue du lac
'
)
expect
(
reply
).
toBe
(
'
rue du lac
'
)
})
})
})
This diff is collapsed.
Click to expand it.
src/helpers/parsing.js
+
2
−
2
View file @
dd7141f8
...
...
@@ -149,12 +149,12 @@ function removeMultipleSpaces(str) {
}
/**
* Remove SGE
useless multiple white spaces
* Remove SGE
address number
* @param {string} str
* @returns {string}
*/
function
removeAddressnumber
(
str
)
{
return
str
.
replace
(
/
[
0-9
]
|b |B |T |t /g
,
''
)
return
str
.
replace
(
/
\d
+
|b |B |T |t
|
\d
+
/g
,
''
)
}
module
.
exports
=
{
...
...
This diff is collapsed.
Click to expand it.
Ghost User
@ghost
mentioned in commit
4138714d
·
2 years ago
mentioned in commit
4138714d
mentioned in commit 4138714d74833b2c9a3e48cca4ca61504b22d32d
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment