aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/cta/Payment/stories.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Payment/stories.tsx')
-rw-r--r--packages/taler-wallet-webextension/src/cta/Payment/stories.tsx40
1 files changed, 18 insertions, 22 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Payment/stories.tsx b/packages/taler-wallet-webextension/src/cta/Payment/stories.tsx
index 28fcd8db7..b63190236 100644
--- a/packages/taler-wallet-webextension/src/cta/Payment/stories.tsx
+++ b/packages/taler-wallet-webextension/src/cta/Payment/stories.tsx
@@ -24,10 +24,11 @@ import {
MerchantContractTerms as ContractTerms,
PreparePayResultType,
} from "@gnu-taler/taler-util";
+import { tests } from "@gnu-taler/web-util/lib/index.browser";
+import beer from "../../../static-dev/beer.png";
import merchantIcon from "../../../static-dev/merchant-icon.jpeg";
-import { createExample } from "../../test-utils.js";
+import { nullFunction } from "../../mui/handlers.js";
import { BaseView } from "./views.js";
-import beer from "../../../static-dev/beer.png";
export default {
title: "payment",
@@ -35,7 +36,7 @@ export default {
argTypes: {},
};
-export const NoBalance = createExample(BaseView, {
+export const NoBalance = tests.createExample(BaseView, {
status: "no-balance-for-currency",
error: undefined,
amount: Amounts.parseOrThrow("USD:10"),
@@ -44,6 +45,7 @@ export const NoBalance = createExample(BaseView, {
uri: "",
payStatus: {
status: PreparePayResultType.InsufficientBalance,
+ balanceDetails: {} as any,
talerUri: "taler://pay/..",
noncePriv: "",
proposalId: "96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0",
@@ -61,7 +63,7 @@ export const NoBalance = createExample(BaseView, {
},
});
-export const NoEnoughBalance = createExample(BaseView, {
+export const NoEnoughBalance = tests.createExample(BaseView, {
status: "no-enough-balance",
error: undefined,
amount: Amounts.parseOrThrow("USD:10"),
@@ -74,6 +76,7 @@ export const NoEnoughBalance = createExample(BaseView, {
uri: "",
payStatus: {
status: PreparePayResultType.InsufficientBalance,
+ balanceDetails: {} as any,
talerUri: "taler://pay/..",
noncePriv: "",
proposalId: "96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0",
@@ -91,7 +94,7 @@ export const NoEnoughBalance = createExample(BaseView, {
},
});
-export const EnoughBalanceButRestricted = createExample(BaseView, {
+export const EnoughBalanceButRestricted = tests.createExample(BaseView, {
status: "no-enough-balance",
error: undefined,
amount: Amounts.parseOrThrow("USD:10"),
@@ -104,6 +107,7 @@ export const EnoughBalanceButRestricted = createExample(BaseView, {
uri: "",
payStatus: {
status: PreparePayResultType.InsufficientBalance,
+ balanceDetails: {} as any,
talerUri: "taler://pay/..",
noncePriv: "",
proposalId: "96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0",
@@ -121,7 +125,7 @@ export const EnoughBalanceButRestricted = createExample(BaseView, {
},
});
-export const PaymentPossible = createExample(BaseView, {
+export const PaymentPossible = tests.createExample(BaseView, {
status: "ready",
error: undefined,
amount: Amounts.parseOrThrow("USD:10"),
@@ -131,9 +135,7 @@ export const PaymentPossible = createExample(BaseView, {
value: 11,
},
payHandler: {
- onClick: async () => {
- null;
- },
+ onClick: nullFunction,
},
uri: "taler://pay/merchant-backend.taler/2021.242-01G2X4275RBWG/?c=66BE594PDZR24744J6EQK52XM0",
@@ -162,7 +164,7 @@ export const PaymentPossible = createExample(BaseView, {
},
});
-export const PaymentPossibleWithFee = createExample(BaseView, {
+export const PaymentPossibleWithFee = tests.createExample(BaseView, {
status: "ready",
error: undefined,
amount: Amounts.parseOrThrow("USD:10"),
@@ -172,9 +174,7 @@ export const PaymentPossibleWithFee = createExample(BaseView, {
value: 11,
},
payHandler: {
- onClick: async () => {
- null;
- },
+ onClick: nullFunction,
},
uri: "taler://pay/merchant-backend.taler/2021.242-01G2X4275RBWG/?c=66BE594PDZR24744J6EQK52XM0",
@@ -200,7 +200,7 @@ export const PaymentPossibleWithFee = createExample(BaseView, {
},
});
-export const TicketWithAProductList = createExample(BaseView, {
+export const TicketWithAProductList = tests.createExample(BaseView, {
status: "ready",
error: undefined,
amount: Amounts.parseOrThrow("USD:10"),
@@ -210,9 +210,7 @@ export const TicketWithAProductList = createExample(BaseView, {
value: 11,
},
payHandler: {
- onClick: async () => {
- null;
- },
+ onClick: nullFunction,
},
uri: "taler://pay/merchant-backend.taler/2021.242-01G2X4275RBWG/?c=66BE594PDZR24744J6EQK52XM0",
@@ -257,7 +255,7 @@ export const TicketWithAProductList = createExample(BaseView, {
},
});
-export const TicketWithShipping = createExample(BaseView, {
+export const TicketWithShipping = tests.createExample(BaseView, {
status: "ready",
error: undefined,
amount: Amounts.parseOrThrow("USD:10"),
@@ -267,9 +265,7 @@ export const TicketWithShipping = createExample(BaseView, {
value: 11,
},
payHandler: {
- onClick: async () => {
- null;
- },
+ onClick: nullFunction,
},
uri: "taler://pay/merchant-backend.taler/2021.242-01G2X4275RBWG/?c=66BE594PDZR24744J6EQK52XM0",
@@ -309,7 +305,7 @@ export const TicketWithShipping = createExample(BaseView, {
},
});
-export const AlreadyConfirmedByOther = createExample(BaseView, {
+export const AlreadyConfirmedByOther = tests.createExample(BaseView, {
status: "confirmed",
error: undefined,
amount: Amounts.parseOrThrow("USD:10"),