diff options
Diffstat (limited to 'packages/aml-backoffice-ui/src/context')
-rw-r--r-- | packages/aml-backoffice-ui/src/context/config.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/aml-backoffice-ui/src/context/config.ts b/packages/aml-backoffice-ui/src/context/config.ts index 2866717de..2df7ff40d 100644 --- a/packages/aml-backoffice-ui/src/context/config.ts +++ b/packages/aml-backoffice-ui/src/context/config.ts @@ -35,6 +35,14 @@ const Context = createContext<Type>(undefined as any); export const useExchangeApiContext = (): Type => useContext(Context); +export function ExchangeApiContextTesting({ config, children }: { config: TalerExchangeApi.ExchangeVersionResponse, children?: ComponentChildren; }): VNode { + return h(Context.Provider, { + value: { url: new URL("http://testing"), config, api: null as any }, + children + } + ) +} + export type ConfigResult = undefined | { type: "ok", config: TalerExchangeApi.ExchangeVersionResponse } | { type: "incompatible", result: TalerExchangeApi.ExchangeVersionResponse, supported: string } |