From f470f167e32d8f7775ad994f09afb1d353b0b300 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 21 Apr 2023 10:47:47 -0300 Subject: integrate anastasis to the web-utils testing api --- packages/anastasis-webui/src/utils/index.tsx | 57 +--------------------------- 1 file changed, 1 insertion(+), 56 deletions(-) (limited to 'packages/anastasis-webui/src/utils/index.tsx') diff --git a/packages/anastasis-webui/src/utils/index.tsx b/packages/anastasis-webui/src/utils/index.tsx index 4cf839473..88bcac551 100644 --- a/packages/anastasis-webui/src/utils/index.tsx +++ b/packages/anastasis-webui/src/utils/index.tsx @@ -21,67 +21,12 @@ import { ReducerState, ReducerStateRecovery, } from "@gnu-taler/anastasis-core"; -import { ComponentChildren, FunctionalComponent, h, VNode } from "preact"; -import { AnastasisProvider } from "../context/anastasis.js"; +import { VNode } from "preact"; const noop = async (): Promise => { return; }; -export function createExampleWithoutAnastasis( - Component: FunctionalComponent, - props: Partial | (() => Partial), -): ComponentChildren { - //FIXME: props are evaluated on build time - // in some cases we want to evaluated the props on render time so we can get some relative timestamp - // check how we can build evaluatedProps in render time - const evaluatedProps = typeof props === "function" ? props() : props; - const Render = (args: any): VNode => h(Component, args); - return { - component: Render, - props: evaluatedProps, - }; -} - -export function createExample( - Component: FunctionalComponent, - currentReducerState?: ReducerState, - props?: Partial, -): ComponentChildren { - const Render = (args: Props): VNode => { - return ( - { - return "{}"; - }, - importState: noop, - }} - > - - - ); - }; - return { - component: Render, - props: props, - }; -} - const base = { continents: [ { -- cgit v1.2.3