fix(transport) : intégration QUALIMAT — copie locale seulement après PATCH réussi (évite un état non persisté) (ERP-166)
This commit is contained in:
@@ -404,6 +404,23 @@ describe('useCarrierForm — copie QUALIMAT (ERP-166)', () => {
|
||||
)
|
||||
})
|
||||
|
||||
it('après création : PATCH en échec → pas de copie locale (rollback) et retour false', async () => {
|
||||
mockPost.mockResolvedValueOnce({ id: 9, name: 'X', certificationType: 'GMP_PLUS' })
|
||||
mockPatch.mockRejectedValueOnce({ response: { status: 500, _data: {} } })
|
||||
const form = useCarrierForm()
|
||||
form.main.name = 'X'
|
||||
form.main.certificationType = 'GMP_PLUS'
|
||||
await form.submitMain()
|
||||
|
||||
const ok = await form.applyQualimatSelection(QUALIMAT_ROW)
|
||||
|
||||
// Échec serveur : l'UI ne doit pas refléter une intégration QUALIMAT non persistée.
|
||||
expect(ok).toBe(false)
|
||||
expect(form.main.name).toBe('X')
|
||||
expect(form.main.certificationType).toBe('GMP_PLUS')
|
||||
expect(form.main.qualimatCarrierIri).toBeNull()
|
||||
})
|
||||
|
||||
it('buildMainPayload inclut qualimatCarrier + certificationType QUALIMAT après intégration', async () => {
|
||||
const form = useCarrierForm()
|
||||
form.main.name = 'Acme'
|
||||
|
||||
Reference in New Issue
Block a user