diff options
Diffstat (limited to 'packages/aml-backoffice-ui/src/stories.test.ts')
-rw-r--r-- | packages/aml-backoffice-ui/src/stories.test.ts | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/packages/aml-backoffice-ui/src/stories.test.ts b/packages/aml-backoffice-ui/src/stories.test.ts index 3b1d0267d..eca66cb18 100644 --- a/packages/aml-backoffice-ui/src/stories.test.ts +++ b/packages/aml-backoffice-ui/src/stories.test.ts @@ -18,7 +18,7 @@ * * @author Sebastian Javier Marchano (sebasjm) */ -import { setupI18n } from "@gnu-taler/taler-util"; +import { TalerExchangeApi, setupI18n } from "@gnu-taler/taler-util"; import { parseGroupImport } from "@gnu-taler/web-util/browser"; import * as tests from "@gnu-taler/web-util/testing"; @@ -26,12 +26,13 @@ import * as tests from "@gnu-taler/web-util/testing"; import * as pages from "./pages/index.stories.js"; import { ComponentChildren, Fragment, VNode, h as create } from "preact"; +import { ExchangeApiContextTesting } from "./context/config.js"; // import { BackendStateProviderTesting } from "./context/backend.js"; setupI18n("en", { en: {} }); describe("All the examples:", () => { - const cms = parseGroupImport({pages}); + const cms = parseGroupImport({ pages }); cms.forEach((group) => { describe(`Example for group "${group.title}:"`, () => { group.list.forEach((component) => { @@ -47,10 +48,24 @@ describe("All the examples:", () => { }); }); + function DefaultTestingContext({ children, }: { children: ComponentChildren; }): VNode { - return create(Fragment, {}); + const config: TalerExchangeApi.ExchangeVersionResponse = { + currency: "ARS", + currency_specification: { + alt_unit_names: {}, + name: "ARS", + num_fractional_input_digits: 2, + num_fractional_normal_digits: 2, + num_fractional_trailing_zero_digits: 2 + }, + name: "taler-exchange", + supported_kyc_requirements: [], + version: "asd", + } + return create(ExchangeApiContextTesting, { config, children }); } |