feat(cotizador): tope de mensualidades = meses que faltan para la entrega (UI y API); nunca se rebasa la fecha de entrega

This commit is contained in:
2026-09-29 20:50:25 +00:00
parent 4e3ce67ae7
commit ed367582c3
7 changed files with 94 additions and 30 deletions

View File

@@ -4,6 +4,7 @@ import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/re
import { MemoryRouter } from 'react-router-dom'
import CotizadorPage from './CotizadorPage'
import { INVENTARIO_SEED } from '../data/unidades'
import { mensualidadesParaUnidad } from '../hooks/useCotizacion'
/**
* Smoke del cierre de la cotización con el esquema único FRASA 2026:
@@ -70,7 +71,8 @@ describe('CotizadorPage — barra sticky y guardado local', () => {
expect(await screen.findByText('Esquema FRASA 2026 — conceptos')).toBeTruthy()
expect(screen.getByText('Hoy')).toBeTruthy()
expect(screen.getByText('A la firma')).toBeTruthy()
expect(screen.getByRole('option', { name: '14 mensualidades' })).toBeTruthy()
// El tope de mensualidades son los meses que faltan para la entrega
expect(screen.getByRole('option', { name: `${mensualidadesParaUnidad(unidad)} mensualidades` })).toBeTruthy()
// Guardar con el servidor caído → folio local persistido en el dispositivo
fireEvent.change(screen.getByLabelText(/Nombre del cliente/), {