summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/stories.test.ts
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-04-21 10:49:47 -0300
committerSebastian <sebasjm@gmail.com>2023-04-21 10:49:47 -0300
commitdbb3529b4909663a02c6a410777795294f0b5a16 (patch)
tree5158222a5e137aa25536a0686f295598443dc71f /packages/taler-wallet-webextension/src/stories.test.ts
parent7fe5f3767ea256fc9ebe4b5ef3f79d4c168a331f (diff)
downloadwallet-core-dbb3529b4909663a02c6a410777795294f0b5a16.tar.gz
wallet-core-dbb3529b4909663a02c6a410777795294f0b5a16.tar.bz2
wallet-core-dbb3529b4909663a02c6a410777795294f0b5a16.zip
remove old testing function, use web-utils
Diffstat (limited to 'packages/taler-wallet-webextension/src/stories.test.ts')
-rw-r--r--packages/taler-wallet-webextension/src/stories.test.ts27
1 files changed, 15 insertions, 12 deletions
diff --git a/packages/taler-wallet-webextension/src/stories.test.ts b/packages/taler-wallet-webextension/src/stories.test.ts
index 76e3db5f4..bf6ef2afe 100644
--- a/packages/taler-wallet-webextension/src/stories.test.ts
+++ b/packages/taler-wallet-webextension/src/stories.test.ts
@@ -19,7 +19,7 @@
* @author Sebastian Javier Marchano (sebasjm)
*/
import { setupI18n } from "@gnu-taler/taler-util";
-import { parseGroupImport } from "@gnu-taler/web-util/lib/index.browser";
+import { parseGroupImport, tests } from "@gnu-taler/web-util/lib/index.browser";
import chromeAPI from "./platform/chrome.js";
import { setupPlatform } from "./platform/foreground.js";
@@ -28,8 +28,8 @@ 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 { renderNodeOrBrowser } from "./test-utils.js";
+import { h, VNode, ComponentChildren } from "preact";
import { AlertProvider } from "./context/alert.js";
setupI18n("en", { en: {} });
@@ -43,15 +43,7 @@ describe("All the examples:", () => {
describe(`Component ${component.name}:`, () => {
component.examples.forEach((example) => {
it(`should render example: ${example.name}`, () => {
- 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 state function
- // until then, we ran the tests with the alert provider
- return h(AlertProvider, { children: B }, B);
- }
- renderNodeOrBrowser(C, {});
+ tests.renderUI(example.render, DefaultTestingContext);
});
});
});
@@ -59,3 +51,14 @@ describe("All the examples:", () => {
});
});
});
+function DefaultTestingContext({
+ children,
+}: {
+ children: ComponentChildren;
+}): VNode {
+ //FIXME:
+ //some components push the alter in the UI function
+ //that's not correct, should be moved into the state function
+ // until then, we ran the tests with the alert provider
+ return h(AlertProvider, { children });
+}