gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] 06/13: allow the example to add params to the testin


From: gnunet
Subject: [taler-wallet-core] 06/13: allow the example to add params to the testing context
Date: Fri, 21 Apr 2023 16:07:03 +0200

This is an automated email from the git hooks/post-receive script.

sebasjm pushed a commit to branch master
in repository wallet-core.

commit 9fe1c4b5ec26b6420a30d328fa058f2eb0bb118a
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Fri Apr 21 10:43:17 2023 -0300

    allow the example to add params to the testing context
---
 packages/web-util/src/stories.tsx | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/packages/web-util/src/stories.tsx 
b/packages/web-util/src/stories.tsx
index a8a9fdf77..3f90be13a 100644
--- a/packages/web-util/src/stories.tsx
+++ b/packages/web-util/src/stories.tsx
@@ -323,6 +323,7 @@ function parseExampleImport(
           render: {
             component: exampleValue as FunctionComponent,
             props: {},
+            contextProps: {},
           },
         };
       }
@@ -367,19 +368,22 @@ export interface Group {
   list: ComponentItem[];
 }
 
-export interface ComponentItem {
+export interface ComponentItem<Props extends object = {}> {
   name: string;
-  examples: ExampleItem[];
+  examples: ExampleItem<Props>[];
 }
 
-export interface ExampleItem {
+export type ExampleItemSetup<Props extends object = {}> = {
+  component: FunctionalComponent<Props>;
+  props: Props;
+  contextProps: object;
+};
+
+export interface ExampleItem<Props extends object = {}> {
   group: string;
   component: string;
   name: string;
-  render: {
-    component: FunctionalComponent;
-    props: object;
-  };
+  render: ExampleItemSetup<Props>;
 }
 
 type ComponentOrFolder = MaybeComponent | MaybeFolder;

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]