diff options
Diffstat (limited to 'packages/aml-backoffice-ui/src/stories.tsx')
-rw-r--r-- | packages/aml-backoffice-ui/src/stories.tsx | 51 |
1 files changed, 32 insertions, 19 deletions
diff --git a/packages/aml-backoffice-ui/src/stories.tsx b/packages/aml-backoffice-ui/src/stories.tsx index 017a31ffa..9a23d82fa 100644 --- a/packages/aml-backoffice-ui/src/stories.tsx +++ b/packages/aml-backoffice-ui/src/stories.tsx @@ -1,6 +1,6 @@ /* This file is part of GNU Taler - (C) 2022 Taler Systems S.A. + (C) 2022-2024 Taler Systems S.A. GNU Taler is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -22,10 +22,14 @@ import { strings } from "./i18n/strings.js"; import * as pages from "./pages/index.stories.js"; -import { renderStories } from "@gnu-taler/web-util/browser"; +import { + ExchangeApiProviderTesting, + ExchangeContextType, + renderStories, +} from "@gnu-taler/web-util/browser"; +import { TalerExchangeApi } from "@gnu-taler/taler-util"; import { ComponentChildren, FunctionComponent, VNode, h } from "preact"; -import { ExchangeApiContextTesting } from "./context/config.js"; import "./scss/main.css"; function main(): void { @@ -40,24 +44,33 @@ function main(): void { function getWrapperForGroup(): FunctionComponent { return function All({ children }: { children?: ComponentChildren }): VNode { + 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", + }; + const value: ExchangeContextType = { + cancelRequest: () => null, + config, + url: new URL("/", "http://localhost"), + hints: [], + lib: { + exchange: undefined!, //FIXME: mock + }, + onActivity: () => null!, + }; return ( - <ExchangeApiContextTesting - config={{ - 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", - }} - > + <ExchangeApiProviderTesting value={value}> {children} - </ExchangeApiContextTesting> + </ExchangeApiProviderTesting> ); }; } |