Skip to content
Snippets Groups Projects
Commit d8461c00 authored by Bastien DUMONT's avatar Bastien DUMONT :angel:
Browse files

fix tests

parent 49faf451
No related branches found
No related tags found
1 merge request!37fix: remove accents in last names
Pipeline #55096 passed
...@@ -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 recieved are NOT matching 🚫', async () => { it('should throw LOGIN_FAILED when pdl given and received 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 recieved are NOT matching on alternate start 🚫', async () => { it('should throw TERMS_VERSION_MISMATCH when pdl give and received 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 recieved are matching ✅', async () => { it('should return void when pdl give and received 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 recieved are matching with stored inseecode ✅', async () => { it('should return void when pdl give and received 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 recieved are matching with SGE second chance onboarding ✅ ', async () => { it('should return void when pdl give and received 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 recieved are matching with SGE last chance onboarding✅ ', async () => { it('should return void when pdl give and received are matching with SGE last chance onboarding✅ ', async () => {
findUserPdl findUserPdl
.mockResolvedValueOnce(null) .mockResolvedValueOnce(null)
.mockResolvedValueOnce(null) .mockResolvedValueOnce(null)
......
{
"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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment