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

---
 .../home/AuthenticationEditorScreen.stories.tsx    | 116 +++++++++++----------
 1 file changed, 63 insertions(+), 53 deletions(-)

(limited to 'packages/anastasis-webui/src/pages/home/AuthenticationEditorScreen.stories.tsx')

diff --git a/packages/anastasis-webui/src/pages/home/AuthenticationEditorScreen.stories.tsx b/packages/anastasis-webui/src/pages/home/AuthenticationEditorScreen.stories.tsx
index ba48e2d5c..23212c184 100644
--- a/packages/anastasis-webui/src/pages/home/AuthenticationEditorScreen.stories.tsx
+++ b/packages/anastasis-webui/src/pages/home/AuthenticationEditorScreen.stories.tsx
@@ -20,7 +20,8 @@
  */
 
 import { ReducerState } from "@gnu-taler/anastasis-core";
-import { createExample, reducerStatesExample } from "../../utils/index.js";
+import { tests } from "@gnu-taler/web-util/lib/index.browser";
+import { reducerStatesExample } from "../../utils/index.js";
 import { AuthenticationEditorScreen as TestedComponent } from "./AuthenticationEditorScreen.js";
 
 export default {
@@ -35,63 +36,72 @@ export default {
   },
 };
 
-export const InitialState = createExample(
+export const InitialState = tests.createExample(
   TestedComponent,
+  {},
   reducerStatesExample.authEditing,
 );
-export const OneAuthMethodConfigured = createExample(TestedComponent, {
-  ...reducerStatesExample.authEditing,
-  authentication_methods: [
-    {
-      type: "question",
-      instructions: "what time is it?",
-      challenge: "asd",
-    },
-  ],
-} as ReducerState);
+export const OneAuthMethodConfigured = tests.createExample(
+  TestedComponent,
+  {},
+  {
+    ...reducerStatesExample.authEditing,
+    authentication_methods: [
+      {
+        type: "question",
+        instructions: "what time is it?",
+        challenge: "asd",
+      },
+    ],
+  } as ReducerState,
+);
 
-export const SomeMoreAuthMethodConfigured = createExample(TestedComponent, {
-  ...reducerStatesExample.authEditing,
-  authentication_methods: [
-    {
-      type: "question",
-      instructions: "what time is it?",
-      challenge: "asd",
-    },
-    {
-      type: "question",
-      instructions: "what time is it?",
-      challenge: "qwe",
-    },
-    {
-      type: "sms",
-      instructions: "what time is it?",
-      challenge: "asd",
-    },
-    {
-      type: "email",
-      instructions: "what time is it?",
-      challenge: "asd",
-    },
-    {
-      type: "email",
-      instructions: "what time is it?",
-      challenge: "asd",
-    },
-    {
-      type: "email",
-      instructions: "what time is it?",
-      challenge: "asd",
-    },
-    {
-      type: "email",
-      instructions: "what time is it?",
-      challenge: "asd",
-    },
-  ],
-} as ReducerState);
+export const SomeMoreAuthMethodConfigured = tests.createExample(
+  TestedComponent,
+  {},
+  {
+    ...reducerStatesExample.authEditing,
+    authentication_methods: [
+      {
+        type: "question",
+        instructions: "what time is it?",
+        challenge: "asd",
+      },
+      {
+        type: "question",
+        instructions: "what time is it?",
+        challenge: "qwe",
+      },
+      {
+        type: "sms",
+        instructions: "what time is it?",
+        challenge: "asd",
+      },
+      {
+        type: "email",
+        instructions: "what time is it?",
+        challenge: "asd",
+      },
+      {
+        type: "email",
+        instructions: "what time is it?",
+        challenge: "asd",
+      },
+      {
+        type: "email",
+        instructions: "what time is it?",
+        challenge: "asd",
+      },
+      {
+        type: "email",
+        instructions: "what time is it?",
+        challenge: "asd",
+      },
+    ],
+  } as ReducerState,
+);
 
-export const NoAuthMethodProvided = createExample(TestedComponent, {
+export const NoAuthMethodProvided = tests.createExample(TestedComponent, {}, {
   ...reducerStatesExample.authEditing,
   authentication_providers: {},
   authentication_methods: [],
-- 
cgit v1.2.3

