diff options
Diffstat (limited to 'packages/demobank-ui/src/stories.test.ts')
-rw-r--r-- | packages/demobank-ui/src/stories.test.ts | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/packages/demobank-ui/src/stories.test.ts b/packages/demobank-ui/src/stories.test.ts index 265304b25..09de227b8 100644 --- a/packages/demobank-ui/src/stories.test.ts +++ b/packages/demobank-ui/src/stories.test.ts @@ -18,7 +18,7 @@ * * @author Sebastian Javier Marchano (sebasjm) */ -import { AccessToken, setupI18n } from "@gnu-taler/taler-util"; +import { AccessToken, TalerCorebankApi, setupI18n } from "@gnu-taler/taler-util"; import { parseGroupImport } from "@gnu-taler/web-util/browser"; import * as tests from "@gnu-taler/web-util/testing"; import * as components from "./components/index.examples.js"; @@ -26,6 +26,7 @@ import * as pages from "./pages/index.stories.js"; import { ComponentChildren, VNode, h as create } from "preact"; import { BackendStateProviderTesting } from "./context/backend.js"; +import { BankCoreApiProviderTesting } from "./context/config.js"; setupI18n("en", { en: {} }); @@ -51,7 +52,7 @@ function DefaultTestingContext({ }: { children: ComponentChildren; }): VNode { - return create(BackendStateProviderTesting, { + const ctx1 = create(BackendStateProviderTesting, { children, state: { status: "loggedIn", @@ -60,4 +61,23 @@ function DefaultTestingContext({ isUserAdministrator: false, }, }); + const cfg: TalerCorebankApi.Config = { + name: "libeufin-bank", + allow_deletions: true, + allow_registrations: true, + currency: { + name: "ARS", + alt_unit_names: {}, + num_fractional_input_digits: 2, + num_fractional_normal_digits: 2, + num_fractional_trailing_zero_digits: 2, + }, + version: "1:0:0", + } + const ctx2 = create(BankCoreApiProviderTesting, { + children: ctx1, + state: cfg, + url: "http://localhost", + }); + return ctx2; } |