FactuGES_ERP/apps/web/src/pages/render-error-fallback.test.tsx
david 26e2ee59bd feat: add error handling and feedback state management for customer and proforma updates
- Implemented feedback state resolution for proforma list and update pages.
- Created error view models for proforma and customer updates, including handling for various error types.
- Added tests for error handling in proforma and customer list updates.
- Introduced utility functions for building error view models and resolving feedback states.
- Ensured translation support for error messages in Spanish.
- Removed duplicate error alert components in customer module.
2026-08-06 13:03:48 +02:00

18 lines
633 B
TypeScript

import assert from "node:assert/strict";
import test from "node:test";
import { renderToStaticMarkup } from "react-dom/server";
import { RenderErrorFallback } from "./render-error-fallback";
test("renderiza un fallback de error inesperado sin detalles técnicos", () => {
const html = renderToStaticMarkup(
<RenderErrorFallback onGoHome={() => undefined} resetErrorBoundary={() => undefined} />
);
assert.match(html, /Se ha producido un error inesperado/);
assert.match(html, /Intentar de nuevo/);
assert.match(html, /Ir al inicio/);
assert.doesNotMatch(html, /stack/i);
assert.doesNotMatch(html, /Error:/);
});