aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/cta/Withdraw/stories.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Withdraw/stories.tsx')
-rw-r--r--packages/taler-wallet-webextension/src/cta/Withdraw/stories.tsx49
1 files changed, 14 insertions, 35 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/stories.tsx b/packages/taler-wallet-webextension/src/cta/Withdraw/stories.tsx
index a8031223b..cde03dd8f 100644
--- a/packages/taler-wallet-webextension/src/cta/Withdraw/stories.tsx
+++ b/packages/taler-wallet-webextension/src/cta/Withdraw/stories.tsx
@@ -20,7 +20,8 @@
*/
import { ExchangeListItem } from "@gnu-taler/taler-util";
-import { createExample } from "../../test-utils.js";
+import { tests } from "@gnu-taler/web-util/lib/index.browser";
+import { nullFunction } from "../../mui/handlers.js";
// import { TermsState } from "../../utils/index.js";
import { SuccessView } from "./views.js";
@@ -28,28 +29,6 @@ export default {
title: "withdraw",
};
-const exchangeList = {
- "exchange.demo.taler.net": "http://exchange.demo.taler.net (USD)",
- "exchange.test.taler.net": "http://exchange.test.taler.net (KUDOS)",
-};
-
-const nullHandler = {
- onClick: async (): Promise<void> => {
- null;
- },
-};
-
-// const normalTosState = {
-// terms: {
-// status: "accepted",
-// version: "",
-// } as TermsState,
-// onAccept: () => null,
-// onReview: () => null,
-// reviewed: false,
-// reviewing: false,
-// };
-
const ageRestrictionOptions: Record<string, string> = "6:12:18"
.split(":")
.reduce((p, c) => ({ ...p, [c]: `under ${c}` }), {});
@@ -61,7 +40,7 @@ const ageRestrictionSelectField = {
value: "0",
};
-export const TermsOfServiceNotYetLoaded = createExample(SuccessView, {
+export const TermsOfServiceNotYetLoaded = tests.createExample(SuccessView, {
error: undefined,
status: "success",
chosenAmount: {
@@ -69,7 +48,7 @@ export const TermsOfServiceNotYetLoaded = createExample(SuccessView, {
value: 2,
fraction: 10000000,
},
- doWithdrawal: nullHandler,
+ doWithdrawal: { onClick: nullFunction },
currentExchange: {
exchangeBaseUrl: "https://exchange.demo.taler.net",
tos: {},
@@ -87,7 +66,7 @@ export const TermsOfServiceNotYetLoaded = createExample(SuccessView, {
},
});
-export const WithSomeFee = createExample(SuccessView, {
+export const WithSomeFee = tests.createExample(SuccessView, {
error: undefined,
status: "success",
chosenAmount: {
@@ -95,7 +74,7 @@ export const WithSomeFee = createExample(SuccessView, {
value: 2,
fraction: 10000000,
},
- doWithdrawal: nullHandler,
+ doWithdrawal: { onClick: nullFunction },
currentExchange: {
exchangeBaseUrl: "https://exchange.demo.taler.net",
tos: {},
@@ -113,7 +92,7 @@ export const WithSomeFee = createExample(SuccessView, {
doSelectExchange: {},
});
-export const WithoutFee = createExample(SuccessView, {
+export const WithoutFee = tests.createExample(SuccessView, {
error: undefined,
status: "success",
chosenAmount: {
@@ -121,7 +100,7 @@ export const WithoutFee = createExample(SuccessView, {
value: 2,
fraction: 0,
},
- doWithdrawal: nullHandler,
+ doWithdrawal: { onClick: nullFunction },
currentExchange: {
exchangeBaseUrl: "https://exchange.demo.taler.net",
tos: {},
@@ -139,7 +118,7 @@ export const WithoutFee = createExample(SuccessView, {
},
});
-export const EditExchangeUntouched = createExample(SuccessView, {
+export const EditExchangeUntouched = tests.createExample(SuccessView, {
error: undefined,
status: "success",
chosenAmount: {
@@ -147,7 +126,7 @@ export const EditExchangeUntouched = createExample(SuccessView, {
value: 2,
fraction: 10000000,
},
- doWithdrawal: nullHandler,
+ doWithdrawal: { onClick: nullFunction },
currentExchange: {
exchangeBaseUrl: "https://exchange.demo.taler.net",
tos: {},
@@ -165,7 +144,7 @@ export const EditExchangeUntouched = createExample(SuccessView, {
},
});
-export const EditExchangeModified = createExample(SuccessView, {
+export const EditExchangeModified = tests.createExample(SuccessView, {
error: undefined,
status: "success",
chosenAmount: {
@@ -173,7 +152,7 @@ export const EditExchangeModified = createExample(SuccessView, {
value: 2,
fraction: 10000000,
},
- doWithdrawal: nullHandler,
+ doWithdrawal: { onClick: nullFunction },
currentExchange: {
exchangeBaseUrl: "https://exchange.demo.taler.net",
tos: {},
@@ -191,7 +170,7 @@ export const EditExchangeModified = createExample(SuccessView, {
},
});
-export const WithAgeRestriction = createExample(SuccessView, {
+export const WithAgeRestriction = tests.createExample(SuccessView, {
error: undefined,
status: "success",
ageRestriction: ageRestrictionSelectField,
@@ -201,7 +180,7 @@ export const WithAgeRestriction = createExample(SuccessView, {
fraction: 10000000,
},
doSelectExchange: {},
- doWithdrawal: nullHandler,
+ doWithdrawal: { onClick: nullFunction },
currentExchange: {
exchangeBaseUrl: "https://exchange.demo.taler.net",
tos: {},