diff options
author | Sebastian <sebasjm@gmail.com> | 2023-01-09 20:20:09 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-01-09 20:20:09 -0300 |
commit | 4a781bd0dd8828ce152f6ab2c3f1bbd6b5e826f7 (patch) | |
tree | 5c16976f99eb973ff62d78ed64107ca01df57b99 /packages/taler-wallet-webextension/src/stories.test.ts | |
parent | 8a70edb2f8e235c3462127b0aa4e1b65aa1aee0b (diff) | |
download | wallet-core-4a781bd0dd8828ce152f6ab2c3f1bbd6b5e826f7.tar.gz wallet-core-4a781bd0dd8828ce152f6ab2c3f1bbd6b5e826f7.tar.bz2 wallet-core-4a781bd0dd8828ce152f6ab2c3f1bbd6b5e826f7.zip |
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
Diffstat (limited to 'packages/taler-wallet-webextension/src/stories.test.ts')
-rw-r--r-- | packages/taler-wallet-webextension/src/stories.test.ts | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/packages/taler-wallet-webextension/src/stories.test.ts b/packages/taler-wallet-webextension/src/stories.test.ts index 47061282d..f02aa5cba 100644 --- a/packages/taler-wallet-webextension/src/stories.test.ts +++ b/packages/taler-wallet-webextension/src/stories.test.ts @@ -20,15 +20,17 @@ */ import { setupI18n } from "@gnu-taler/taler-util"; import { parseGroupImport } from "@gnu-taler/web-util/lib/index.browser"; -import { setupPlatform } from "./platform/foreground.js"; import chromeAPI from "./platform/chrome.js"; -import { renderNodeOrBrowser } from "./test-utils.js"; +import { setupPlatform } from "./platform/foreground.js"; import * as components from "./components/index.stories.js"; import * as cta from "./cta/index.stories.js"; import * as mui from "./mui/index.stories.js"; import * as popup from "./popup/index.stories.js"; import * as wallet from "./wallet/index.stories.js"; +import { renderNodeOrBrowser } from "./test-utils.js"; +import { h, VNode } from "preact"; +import { AlertProvider } from "./context/alert.js"; setupI18n("en", { en: {} }); setupPlatform(chromeAPI); @@ -41,10 +43,15 @@ describe("All the examples:", () => { describe(`Component ${component.name}:`, () => { component.examples.forEach((example) => { it(`should render example: ${example.name}`, () => { - renderNodeOrBrowser( - example.render.component, - example.render.props, - ); + function C(): VNode { + const B = h(example.render.component, example.render.props); + //FIXME: + //some components push the alter in the UI function + //that's not correct, should be moved into the sate function + // until then, we ran the tests with the alert provider + return h(AlertProvider, { children: B }, B); + } + renderNodeOrBrowser(C, {}); }); }); }); |