- 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.
18 lines
633 B
TypeScript
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:/);
|
|
});
|