[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.
- [taler-wallet-core] branch master updated (45bbe7ba1 -> fc2adae6b), gnunet, 2023/04/21
- [taler-wallet-core] 02/13: moving libs to web utils, apply new mock api to backoffice, gnunet, 2023/04/21
- [taler-wallet-core] 01/13: better swr mocks, gnunet, 2023/04/21
- [taler-wallet-core] 03/13: test file end with -test.js, gnunet, 2023/04/21
- [taler-wallet-core] 04/13: running all tests in sequential mode, otherwise it will fail (maybe ava can't run in parallel?), gnunet, 2023/04/21
- [taler-wallet-core] 06/13: allow the example to add params to the testing context,
gnunet <=
- [taler-wallet-core] 08/13: use better testing api, gnunet, 2023/04/21
- [taler-wallet-core] 05/13: fix bulid, gnunet, 2023/04/21
- [taler-wallet-core] 09/13: integrate anastasis to the web-utils testing api, gnunet, 2023/04/21
- [taler-wallet-core] 10/13: integrate to the web util testing api, gnunet, 2023/04/21
- [taler-wallet-core] 07/13: render hook and render ui are not the same function (node and browser), gnunet, 2023/04/21
- [taler-wallet-core] 13/13: props types should be exported for tests, gnunet, 2023/04/21
- [taler-wallet-core] 12/13: tsc ask to export type from web-util, gnunet, 2023/04/21
- [taler-wallet-core] 11/13: remove old testing function, use web-utils, gnunet, 2023/04/21