diff --git a/__tests__/core/verifyUserIdentity.spec.js b/__tests__/core/verifyUserIdentity.spec.js index 390396dd5918cf588485c0ffd3a13e3656a0f699..db9d1613944a3e14f319bba431f406e0295cfa98 100644 --- a/__tests__/core/verifyUserIdentity.spec.js +++ b/__tests__/core/verifyUserIdentity.spec.js @@ -10,12 +10,16 @@ jest.mock('../../src/requests/insee', () => ({ getInseeCode: jest.fn().mockResolvedValue(69), })) +jest.mock('../../src/helpers/sanitizeName.js', () => ({ + sanitizeLastname: jest.fn().mockReturnValue('John'), +})) + jest.mock('../../src/index', () => ({ start: jest.fn(), })) 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') try { await 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') try { await 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') expect.assertions(1) try { @@ -76,7 +80,7 @@ describe('verifyUserIdentity', () => { 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') expect.assertions(1) try { @@ -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') findUserAddress.mockResolvedValueOnce({ escalierEtEtageEtAppartement: '12', @@ -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 .mockResolvedValueOnce(null) .mockResolvedValueOnce(null) diff --git a/importedData.json b/importedData.json new file mode 100644 index 0000000000000000000000000000000000000000..480333f0459ab7a100b3baa0a86e0bbd4f4a5e8c --- /dev/null +++ b/importedData.json @@ -0,0 +1,30 @@ +{ + "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