fix(auditoria): afluencia (validacion, update sin perder datos ni retroceder etapa, dedup cruzado, notas), alta cliente (registro tras firma, documentos por cliente, aviso de fallos) y reporte de clientes aplanado
This commit is contained in:
@@ -4,7 +4,18 @@ import AltaClientePage from './AltaClientePage'
|
||||
|
||||
// El lienzo de firma necesita canvas 2d (no existe en jsdom); el paso 7 se
|
||||
// prueba solo hasta la orquestación de la página, no el trazo de la firma.
|
||||
vi.mock('../forms/FirmasForm', () => ({ default: () => <div>Paso de firmas</div> }))
|
||||
// Stub del paso de firmas: expone el botón de registro (el registro del alta
|
||||
// ahora se dispara desde este paso, no al salir de Documentos)
|
||||
vi.mock('../forms/FirmasForm', () => ({
|
||||
default: ({ onRegistrar }: { onRegistrar?: () => void }) => (
|
||||
<div>
|
||||
<p>Paso de firmas</p>
|
||||
<button type="button" onClick={onRegistrar}>
|
||||
Registrar alta
|
||||
</button>
|
||||
</div>
|
||||
),
|
||||
}))
|
||||
|
||||
type FetchFn = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>
|
||||
|
||||
@@ -136,8 +147,11 @@ describe('AltaClientePage — guardado progresivo (etapa por etapa)', () => {
|
||||
fireEvent.change(await screen.findByLabelText(/^Proyecto/), { target: { value: 'DIAGONAL' } })
|
||||
await avanzar() // Vivienda → Documentos
|
||||
|
||||
// Documentos → Firmas: dispara el submit final del alta
|
||||
// Documentos → Firmas: ya NO registra el alta (se registra tras firmar)
|
||||
await avanzar()
|
||||
expect(llamadasA('/clientes/progreso/prog-1/completar', 'POST')).toHaveLength(0)
|
||||
// El registro se dispara con el botón del paso de firmas
|
||||
fireEvent.click(await screen.findByRole('button', { name: /Registrar alta/ }))
|
||||
await waitFor(() => expect(llamadasA('/clientes/progreso/prog-1/completar', 'POST')).toHaveLength(1))
|
||||
// NO se usó el endpoint legado
|
||||
expect(
|
||||
|
||||
Reference in New Issue
Block a user