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
d8461c00
Commit
d8461c00
authored
2 years ago
by
Bastien DUMONT
Browse files
Options
Downloads
Patches
Plain Diff
fix tests
parent
49faf451
No related branches found
No related tags found
1 merge request
!37
fix: remove accents in last names
Pipeline
#55096
passed
2 years ago
Stage: update-instances
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
__tests__/core/verifyUserIdentity.spec.js
+10
-6
10 additions, 6 deletions
__tests__/core/verifyUserIdentity.spec.js
importedData.json
+30
-0
30 additions, 0 deletions
importedData.json
with
40 additions
and
6 deletions
__tests__/core/verifyUserIdentity.spec.js
+
10
−
6
View file @
d8461c00
...
@@ -10,12 +10,16 @@ jest.mock('../../src/requests/insee', () => ({
...
@@ -10,12 +10,16 @@ jest.mock('../../src/requests/insee', () => ({
getInseeCode
:
jest
.
fn
().
mockResolvedValue
(
69
),
getInseeCode
:
jest
.
fn
().
mockResolvedValue
(
69
),
}))
}))
jest
.
mock
(
'
../../src/helpers/sanitizeName.js
'
,
()
=>
({
sanitizeLastname
:
jest
.
fn
().
mockReturnValue
(
'
John
'
),
}))
jest
.
mock
(
'
../../src/index
'
,
()
=>
({
jest
.
mock
(
'
../../src/index
'
,
()
=>
({
start
:
jest
.
fn
(),
start
:
jest
.
fn
(),
}))
}))
describe
(
'
verifyUserIdentity
'
,
()
=>
{
describe
(
'
verifyUserIdentity
'
,
()
=>
{
it
(
'
should throw LOGIN_FAILED when pdl given and rec
i
eved are NOT matching 🚫
'
,
async
()
=>
{
it
(
'
should throw LOGIN_FAILED when pdl given and rece
i
ved are NOT matching 🚫
'
,
async
()
=>
{
findUserPdl
.
mockResolvedValueOnce
(
'
12345
'
)
findUserPdl
.
mockResolvedValueOnce
(
'
12345
'
)
try
{
try
{
await
verifyUserIdentity
(
await
verifyUserIdentity
(
...
@@ -35,7 +39,7 @@ describe('verifyUserIdentity', () => {
...
@@ -35,7 +39,7 @@ describe('verifyUserIdentity', () => {
}
}
})
})
it
(
'
should throw TERMS_VERSION_MISMATCH when pdl give and rec
i
eved are NOT matching on alternate start 🚫
'
,
async
()
=>
{
it
(
'
should throw TERMS_VERSION_MISMATCH when pdl give and rece
i
ved are NOT matching on alternate start 🚫
'
,
async
()
=>
{
findUserPdl
.
mockResolvedValueOnce
(
'
12345
'
)
findUserPdl
.
mockResolvedValueOnce
(
'
12345
'
)
try
{
try
{
await
verifyUserIdentity
(
await
verifyUserIdentity
(
...
@@ -56,7 +60,7 @@ describe('verifyUserIdentity', () => {
...
@@ -56,7 +60,7 @@ describe('verifyUserIdentity', () => {
}
}
})
})
it
(
'
should return void when pdl give and rec
i
eved are matching ✅
'
,
async
()
=>
{
it
(
'
should return void when pdl give and rece
i
ved are matching ✅
'
,
async
()
=>
{
findUserPdl
.
mockResolvedValueOnce
(
'
12345
'
)
findUserPdl
.
mockResolvedValueOnce
(
'
12345
'
)
expect
.
assertions
(
1
)
expect
.
assertions
(
1
)
try
{
try
{
...
@@ -76,7 +80,7 @@ describe('verifyUserIdentity', () => {
...
@@ -76,7 +80,7 @@ describe('verifyUserIdentity', () => {
expect
(
true
).
toBe
(
false
)
expect
(
true
).
toBe
(
false
)
}
}
})
})
it
(
'
should return void when pdl give and rec
i
eved are matching with stored inseecode ✅
'
,
async
()
=>
{
it
(
'
should return void when pdl give and rece
i
ved are matching with stored inseecode ✅
'
,
async
()
=>
{
findUserPdl
.
mockResolvedValue
(
'
12345
'
)
findUserPdl
.
mockResolvedValue
(
'
12345
'
)
expect
.
assertions
(
1
)
expect
.
assertions
(
1
)
try
{
try
{
...
@@ -99,7 +103,7 @@ describe('verifyUserIdentity', () => {
...
@@ -99,7 +103,7 @@ describe('verifyUserIdentity', () => {
}
}
})
})
it
(
'
should return void when pdl give and rec
i
eved are matching with SGE second chance onboarding ✅
'
,
async
()
=>
{
it
(
'
should return void when pdl give and rece
i
ved are matching with SGE second chance onboarding ✅
'
,
async
()
=>
{
findUserPdl
.
mockResolvedValueOnce
(
null
).
mockResolvedValueOnce
(
'
12345
'
)
findUserPdl
.
mockResolvedValueOnce
(
null
).
mockResolvedValueOnce
(
'
12345
'
)
findUserAddress
.
mockResolvedValueOnce
({
findUserAddress
.
mockResolvedValueOnce
({
escalierEtEtageEtAppartement
:
'
12
'
,
escalierEtEtageEtAppartement
:
'
12
'
,
...
@@ -127,7 +131,7 @@ describe('verifyUserIdentity', () => {
...
@@ -127,7 +131,7 @@ describe('verifyUserIdentity', () => {
}
}
})
})
it
(
'
should return void when pdl give and rec
i
eved are matching with SGE last chance onboarding✅
'
,
async
()
=>
{
it
(
'
should return void when pdl give and rece
i
ved are matching with SGE last chance onboarding✅
'
,
async
()
=>
{
findUserPdl
findUserPdl
.
mockResolvedValueOnce
(
null
)
.
mockResolvedValueOnce
(
null
)
.
mockResolvedValueOnce
(
null
)
.
mockResolvedValueOnce
(
null
)
...
...
This diff is collapsed.
Click to expand it.
importedData.json
0 → 100644
+
30
−
0
View file @
d8461c00
{
"io.cozy.files"
:
[],
"io.cozy.accounts"
:
[
{
"cozyMetadata"
:
{
"doctypeVersion"
:
1
,
"metadataVersion"
:
1
,
"createdAt"
:
"2023-03-20T15:25:12.714Z"
,
"createdByApp"
:
"enedissgegrandlyon"
,
"createdByAppVersion"
:
"1.2.5"
,
"updatedAt"
:
"2023-03-20T15:25:12.714Z"
,
"updatedByApps"
:
[
{
"slug"
:
"enedissgegrandlyon"
,
"date"
:
"2023-03-20T15:25:12.714Z"
,
"version"
:
"1.2.5"
}
]
},
"_id"
:
"1111111"
,
"account_type"
:
"1111111"
,
"data"
:
{
"name"
:
"pouet"
}
}
],
"com.grandlyon.enedis.year"
:
[],
"com.grandlyon.enedis.month"
:
[],
"com.grandlyon.enedis.minute"
:
[]
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Ghost User
@ghost
mentioned in commit
6b9491c0
·
2 years ago
mentioned in commit
6b9491c0
mentioned in commit 6b9491c02cdeb17371a2a81ff2b34962b47d9e3c
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