diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx b/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx index f1ae84ed3..09f7c4dc1 100644 --- a/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx @@ -21,6 +21,7 @@ import { AbsoluteTime, + AmountString, PaymentStatus, RefreshReason, TalerPreciseTimestamp, @@ -60,8 +61,8 @@ export default { const commonTransaction: TransactionCommon = { error: undefined, - amountRaw: "KUDOS:11", - amountEffective: "KUDOS:9.2", + amountRaw: "KUDOS:11" as AmountString, + amountEffective: "KUDOS:9.2" as AmountString, txState: { major: TransactionMajorState.Done, }, @@ -91,7 +92,7 @@ const exampleData = { } as TransactionWithdrawal, payment: { ...commonTransaction, - amountEffective: "KUDOS:12", + amountEffective: "KUDOS:12" as AmountString, type: TransactionType.Payment, posConfirmation: undefined, info: { @@ -113,8 +114,8 @@ const exampleData = { }, refunds: [], refundPending: undefined, - totalRefundEffective: "KUDOS:0", - totalRefundRaw: "KUDOS:0", + totalRefundEffective: "KUDOS:0" as AmountString, + totalRefundRaw: "KUDOS:0" as AmountString, proposalId: "1EMJJH8EP1NX3XF7733NCYS2DBEJW4Q2KA5KEB37MCQJQ8Q5HMC0", status: PaymentStatus.Accepted, refundQueryActive: false, @@ -131,8 +132,8 @@ const exampleData = { refresh: { ...commonTransaction, type: TransactionType.Refresh, - refreshInputAmount: "KUDOS:1", - refreshOutputAmount: "KUDOS:0.5", + refreshInputAmount: "KUDOS:1" as AmountString, + refreshOutputAmount: "KUDOS:0.5" as AmountString, exchangeBaseUrl: "http://exchange.taler", refreshReason: RefreshReason.Manual, } as TransactionRefresh, @@ -358,14 +359,14 @@ export const PaymentError = tests.createExample(TestedComponent, { export const PaymentWithRefund = tests.createExample(TestedComponent, { transaction: { ...exampleData.payment, - amountRaw: "KUDOS:12", - totalRefundEffective: "KUDOS:1", - totalRefundRaw: "KUDOS:1", + amountRaw: "KUDOS:12" as AmountString, + totalRefundEffective: "KUDOS:1" as AmountString, + totalRefundRaw: "KUDOS:1" as AmountString, refunds: [ { transactionId: "1123123", - amountRaw: "KUDOS:1", - amountEffective: "KUDOS:1", + amountRaw: "KUDOS:1" as AmountString, + amountEffective: "KUDOS:1" as AmountString, timestamp: TalerProtocolTimestamp.fromSeconds(1546546544), }, ], @@ -375,7 +376,7 @@ export const PaymentWithRefund = tests.createExample(TestedComponent, { export const PaymentWithDeliveryDate = tests.createExample(TestedComponent, { transaction: { ...exampleData.payment, - amountRaw: "KUDOS:12", + amountRaw: "KUDOS:12" as AmountString, info: { ...exampleData.payment.info, // delivery_date: { @@ -388,7 +389,7 @@ export const PaymentWithDeliveryDate = tests.createExample(TestedComponent, { export const PaymentWithDeliveryAddr = tests.createExample(TestedComponent, { transaction: { ...exampleData.payment, - amountRaw: "KUDOS:12", + amountRaw: "KUDOS:12" as AmountString, info: { ...exampleData.payment.info, // delivery_location: { @@ -404,7 +405,7 @@ export const PaymentWithDeliveryAddr = tests.createExample(TestedComponent, { export const PaymentWithDeliveryFull = tests.createExample(TestedComponent, { transaction: { ...exampleData.payment, - amountRaw: "KUDOS:12", + amountRaw: "KUDOS:12" as AmountString, info: { ...exampleData.payment.info, // delivery_date: { @@ -423,35 +424,35 @@ export const PaymentWithDeliveryFull = tests.createExample(TestedComponent, { export const PaymentWithRefundPending = tests.createExample(TestedComponent, { transaction: { ...exampleData.payment, - amountRaw: "KUDOS:12", - refundPending: "KUDOS:3", - totalRefundEffective: "KUDOS:1", - totalRefundRaw: "KUDOS:1", + amountRaw: "KUDOS:12" as AmountString, + refundPending: "KUDOS:3" as AmountString, + totalRefundEffective: "KUDOS:1" as AmountString, + totalRefundRaw: "KUDOS:1" as AmountString, }, }); export const PaymentWithFeeAndRefund = tests.createExample(TestedComponent, { transaction: { ...exampleData.payment, - amountRaw: "KUDOS:11", - totalRefundEffective: "KUDOS:1", - totalRefundRaw: "KUDOS:1", + amountRaw: "KUDOS:11" as AmountString, + totalRefundEffective: "KUDOS:1" as AmountString, + totalRefundRaw: "KUDOS:1" as AmountString, }, }); export const PaymentWithFeeAndRefundFee = tests.createExample(TestedComponent, { transaction: { ...exampleData.payment, - amountRaw: "KUDOS:11", - totalRefundEffective: "KUDOS:1", - totalRefundRaw: "KUDOS:2", + amountRaw: "KUDOS:11" as AmountString, + totalRefundEffective: "KUDOS:1" as AmountString, + totalRefundRaw: "KUDOS:2" as AmountString, }, }); export const PaymentWithoutFee = tests.createExample(TestedComponent, { transaction: { ...exampleData.payment, - amountRaw: "KUDOS:12", + amountRaw: "KUDOS:12" as AmountString, }, }); @@ -537,8 +538,8 @@ export const DepositTalerBank = tests.createExample(TestedComponent, { export const DepositBitcoin = tests.createExample(TestedComponent, { transaction: { ...exampleData.deposit, - amountRaw: "BITCOINBTC:0.0000011", - amountEffective: "BITCOINBTC:0.00000092", + amountRaw: "BITCOINBTC:0.0000011" as AmountString, + amountEffective: "BITCOINBTC:0.00000092" as AmountString, targetPaytoUri: "payto://bitcoin/bcrt1q6ps8qs6v8tkqrnru4xqqqa6rfwcx5ufpdfqht4?amount=BTC:0.1&subject=0ZSX8SH0M30KHX8K3Y1DAMVGDQV82XEF9DG1HC4QMQ3QWYT4AF00", }, |