aboutsummaryrefslogtreecommitdiff
path: root/packages/anastasis-webui/src/pages/home/AttributeEntryScreen.stories.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/anastasis-webui/src/pages/home/AttributeEntryScreen.stories.tsx')
-rw-r--r--packages/anastasis-webui/src/pages/home/AttributeEntryScreen.stories.tsx57
1 files changed, 33 insertions, 24 deletions
diff --git a/packages/anastasis-webui/src/pages/home/AttributeEntryScreen.stories.tsx b/packages/anastasis-webui/src/pages/home/AttributeEntryScreen.stories.tsx
index 38fc1b56b..bc62961a5 100644
--- a/packages/anastasis-webui/src/pages/home/AttributeEntryScreen.stories.tsx
+++ b/packages/anastasis-webui/src/pages/home/AttributeEntryScreen.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 { AttributeEntryScreen as TestedComponent } from "./AttributeEntryScreen.js";
export default {
@@ -35,7 +36,7 @@ export default {
},
};
-export const Backup = createExample(TestedComponent, {
+export const Backup = tests.createExample(TestedComponent, {}, {
...reducerStatesExample.backupAttributeEditing,
required_attributes: [
{
@@ -62,7 +63,7 @@ export const Backup = createExample(TestedComponent, {
],
} as ReducerState);
-export const Recovery = createExample(TestedComponent, {
+export const Recovery = tests.createExample(TestedComponent, {}, {
...reducerStatesExample.recoveryAttributeEditing,
required_attributes: [
{
@@ -89,10 +90,14 @@ export const Recovery = createExample(TestedComponent, {
],
} as ReducerState);
-export const WithNoRequiredAttribute = createExample(TestedComponent, {
- ...reducerStatesExample.backupAttributeEditing,
- required_attributes: undefined,
-} as ReducerState);
+export const WithNoRequiredAttribute = tests.createExample(
+ TestedComponent,
+ {},
+ {
+ ...reducerStatesExample.backupAttributeEditing,
+ required_attributes: undefined,
+ } as ReducerState,
+);
const allWidgets = [
"anastasis_gtk_ia_aadhar_in",
@@ -123,7 +128,7 @@ function typeForWidget(name: string): string {
return "string";
}
-export const WithAllPosibleWidget = createExample(TestedComponent, {
+export const WithAllPosibleWidget = tests.createExample(TestedComponent, {}, {
...reducerStatesExample.backupAttributeEditing,
required_attributes: allWidgets.map((w) => ({
name: w,
@@ -134,19 +139,23 @@ export const WithAllPosibleWidget = createExample(TestedComponent, {
})),
} as ReducerState);
-export const WithAutocompleteFeature = createExample(TestedComponent, {
- ...reducerStatesExample.backupAttributeEditing,
- required_attributes: [
- {
- name: "ahv_number",
- label: "AHV Number",
- type: "string",
- uuid: "asdasdsa1",
- widget: "wid",
- "validation-regex":
- "^(756)\\.[0-9]{4}\\.[0-9]{4}\\.[0-9]{2}|(756)[0-9]{10}$",
- "validation-logic": "CH_AHV_check",
- autocomplete: "???.????.????.??",
- },
- ],
-} as ReducerState);
+export const WithAutocompleteFeature = tests.createExample(
+ TestedComponent,
+ {},
+ {
+ ...reducerStatesExample.backupAttributeEditing,
+ required_attributes: [
+ {
+ name: "ahv_number",
+ label: "AHV Number",
+ type: "string",
+ uuid: "asdasdsa1",
+ widget: "wid",
+ "validation-regex":
+ "^(756)\\.[0-9]{4}\\.[0-9]{4}\\.[0-9]{2}|(756)[0-9]{10}$",
+ "validation-logic": "CH_AHV_check",
+ autocomplete: "???.????.????.??",
+ },
+ ],
+ } as ReducerState,
+);