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 | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx b/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx index 656c57324..6f57df315 100644 --- a/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx @@ -31,7 +31,12 @@ import { TransactionWithdrawal, WithdrawalType, } from "@gnu-taler/taler-util"; -import { createExample } from "../test-utils"; +import { ComponentChildren, h } from "preact"; +import { DevContextProviderForTesting } from "../context/devContext"; +import { + createExample, + createExampleWithCustomContext as createExampleInCustomContext, +} from "../test-utils"; import { TransactionView as TestedComponent } from "./Transaction"; export default { @@ -128,6 +133,25 @@ export const Withdraw = createExample(TestedComponent, { transaction: exampleData.withdraw, }); +export const WithdrawOneMinuteAgo = createExample(TestedComponent, { + transaction: { + ...exampleData.withdraw, + timestamp: { + t_ms: new Date().getTime() - 60 * 1000, + }, + }, +}); + +export const WithdrawOneMinuteAgoAndPending = createExample(TestedComponent, { + transaction: { + ...exampleData.withdraw, + timestamp: { + t_ms: new Date().getTime() - 60 * 1000, + }, + pending: true, + }, +}); + export const WithdrawError = createExample(TestedComponent, { transaction: { ...exampleData.withdraw, @@ -135,6 +159,18 @@ export const WithdrawError = createExample(TestedComponent, { }, }); +export const WithdrawErrorInDevMode = createExampleInCustomContext( + TestedComponent, + { + transaction: { + ...exampleData.withdraw, + error: transactionError, + }, + }, + DevContextProviderForTesting, + { value: true }, +); + export const WithdrawPendingManual = createExample(TestedComponent, { transaction: { ...exampleData.withdraw, |