aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/stories.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-webextension/src/stories.test.ts')
-rw-r--r--packages/taler-wallet-webextension/src/stories.test.ts19
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, {});
});
});
});