From 4a781bd0dd8828ce152f6ab2c3f1bbd6b5e826f7 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 9 Jan 2023 20:20:09 -0300 Subject: fix #7153: more error handling if handler do not trap error then fail at compile time, all safe handlers push alert on error errors are typed so they render good information --- packages/taler-wallet-webextension/src/test-utils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'packages/taler-wallet-webextension/src/test-utils.ts') diff --git a/packages/taler-wallet-webextension/src/test-utils.ts b/packages/taler-wallet-webextension/src/test-utils.ts index 7e7ddd88d..085055a7e 100644 --- a/packages/taler-wallet-webextension/src/test-utils.ts +++ b/packages/taler-wallet-webextension/src/test-utils.ts @@ -31,8 +31,10 @@ import { VNode, } from "preact"; import { render as renderToString } from "preact-render-to-string"; +import { AlertProvider } from "./context/alert.js"; import { BackendProvider } from "./context/backend.js"; import { TranslationProvider } from "./context/translation.js"; +import { nullFunction } from "./mui/handlers.js"; import { BackgroundApiClient, wxApi } from "./wxApi.js"; // When doing tests we want the requestAnimationFrame to be as fast as possible. @@ -218,7 +220,7 @@ export function mountHook( }; } -export const nullFunction: any = () => null; +// export const nullFunction: any = () => null; interface MockHandler { addWalletCallResponse( @@ -365,6 +367,7 @@ export function createWalletApiMock(): { children: ComponentChildren; }): VNode { let children = _cs; + children = create(AlertProvider, { children }, children); children = create(TranslationProvider, { children }, children); return create( BackendProvider, -- cgit v1.2.3