From f470f167e32d8f7775ad994f09afb1d353b0b300 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
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<void> => {
   return;
 };
 
-export function createExampleWithoutAnastasis<Props>(
-  Component: FunctionalComponent<Props>,
-  props: Partial<Props> | (() => Partial<Props>),
-): 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<Props>(
-  Component: FunctionalComponent<Props>,
-  currentReducerState?: ReducerState,
-  props?: Partial<Props>,
-): ComponentChildren {
-  const Render = (args: Props): VNode => {
-    return (
-      <AnastasisProvider
-        value={{
-          currentReducerState,
-          discoverMore: noop,
-          discoverStart: noop,
-          discoveryState: {
-            state: "finished",
-          },
-          currentError: undefined,
-          back: noop,
-          dismissError: noop,
-          reset: noop,
-          runTransaction: noop,
-          startBackup: noop,
-          startRecover: noop,
-          transition: noop,
-          exportState: () => {
-            return "{}";
-          },
-          importState: noop,
-        }}
-      >
-        <Component {...(args as any)} />
-      </AnastasisProvider>
-    );
-  };
-  return {
-    component: Render,
-    props: props,
-  };
-}
-
 const base = {
   continents: [
     {
-- 
cgit v1.2.3

