feat(#135): mode édition dossier + ajout co-parent (squash develop).
Wizard edit famille/AM, POST co-parent, PATCH enfants avec photo. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -11,6 +11,7 @@ describe('ParentsController', () => {
|
||||
let controller: ParentsController;
|
||||
const authServiceMock = {
|
||||
createParentDossierStaff: jest.fn(),
|
||||
addCoParentStaff: jest.fn(),
|
||||
};
|
||||
const parentsServiceMock = {};
|
||||
const userServiceMock = {};
|
||||
@@ -77,4 +78,27 @@ describe('ParentsController', () => {
|
||||
expect(res.enfant_ids).toEqual(['e1']);
|
||||
expect(res.statut).toBe(StatutUtilisateurType.ACTIF);
|
||||
});
|
||||
|
||||
it('addCoParent delegates to authService.addCoParentStaff', async () => {
|
||||
authServiceMock.addCoParentStaff.mockResolvedValue({
|
||||
message: 'ok',
|
||||
numero_dossier: '2026-000043',
|
||||
parent_user_id: 'p1',
|
||||
co_parent_user_id: 'p2',
|
||||
statut: StatutUtilisateurType.ACTIF,
|
||||
});
|
||||
|
||||
const body = {
|
||||
email: 'coparent@test.fr',
|
||||
prenom: 'Thomas',
|
||||
nom: 'MARTIN',
|
||||
telephone: '0678456789',
|
||||
meme_adresse: true,
|
||||
};
|
||||
|
||||
const res = await controller.addCoParent('p1', body as any);
|
||||
expect(authServiceMock.addCoParentStaff).toHaveBeenCalledWith('p1', body);
|
||||
expect(res.co_parent_user_id).toBe('p2');
|
||||
expect(res.statut).toBe(StatutUtilisateurType.ACTIF);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user