Skip to content
Snippets Groups Projects

Feat/rechercher point

Merged Bastien DUMONT requested to merge feat/rechercher-point into main
Files
9
+ 28
0
const { createBoConsent } = require('../../src/requests/bo')
import * as axios from 'axios'
jest.mock('axios')
describe('Backoffice routes', () => {
describe('createBoConsent', () => {
it('should send consent to BO', async () => {
const consent = await createBoConsent({
pdl: 11111111111111,
name: 'POUET',
adresse: '20 rue du lac',
postalCode: '69003',
inseeCode: '69383',
})
expect(consent).toBe({ id: 'abce23' })
})
it('should handle unavailable BO', async () => {
axios.post.mockImplementation(() => Promise.reject({ status: 500 }))
const consent = await createBoConsent({
pdl: 11111111111111,
name: 'POUET',
adresse: '20 rue du lac',
postalCode: '69003',
inseeCode: '69383',
})
expect(consent).toBe(null)
})
})
})
Loading