diff options
author | Sebastian <sebasjm@gmail.com> | 2023-01-09 20:20:09 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-01-09 20:20:09 -0300 |
commit | 4a781bd0dd8828ce152f6ab2c3f1bbd6b5e826f7 (patch) | |
tree | 5c16976f99eb973ff62d78ed64107ca01df57b99 /packages/taler-wallet-webextension/src/wallet/History.stories.tsx | |
parent | 8a70edb2f8e235c3462127b0aa4e1b65aa1aee0b (diff) | |
download | wallet-core-4a781bd0dd8828ce152f6ab2c3f1bbd6b5e826f7.tar.xz |
fix #7153: more error handling
if handler do not trap error then fail at compile time,
all safe handlers push alert on error
errors are typed so they render good information
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/History.stories.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/History.stories.tsx | 72 |
1 files changed, 39 insertions, 33 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/History.stories.tsx b/packages/taler-wallet-webextension/src/wallet/History.stories.tsx index 1674ac135..13f4c8230 100644 --- a/packages/taler-wallet-webextension/src/wallet/History.stories.tsx +++ b/packages/taler-wallet-webextension/src/wallet/History.stories.tsx @@ -37,7 +37,7 @@ import { WithdrawalType, } from "@gnu-taler/taler-util"; import { HistoryView as TestedComponent } from "./History.js"; -import { createExample } from "../test-utils.js"; +import { tests } from "@gnu-taler/web-util/lib/index.browser"; export default { title: "balance", @@ -160,25 +160,28 @@ const exampleData = { } as TransactionPeerPullDebit, }; -export const NoBalance = createExample(TestedComponent, { +export const NoBalance = tests.createExample(TestedComponent, { transactions: [], balances: [], }); -export const SomeBalanceWithNoTransactions = createExample(TestedComponent, { - transactions: [], - balances: [ - { - available: "TESTKUDOS:10", - pendingIncoming: "TESTKUDOS:0", - pendingOutgoing: "TESTKUDOS:0", - hasPendingTransactions: false, - requiresUserInput: false, - }, - ], -}); +export const SomeBalanceWithNoTransactions = tests.createExample( + TestedComponent, + { + transactions: [], + balances: [ + { + available: "TESTKUDOS:10", + pendingIncoming: "TESTKUDOS:0", + pendingOutgoing: "TESTKUDOS:0", + hasPendingTransactions: false, + requiresUserInput: false, + }, + ], + }, +); -export const OneSimpleTransaction = createExample(TestedComponent, { +export const OneSimpleTransaction = tests.createExample(TestedComponent, { transactions: [exampleData.withdraw], balances: [ { @@ -191,20 +194,23 @@ export const OneSimpleTransaction = createExample(TestedComponent, { ], }); -export const TwoTransactionsAndZeroBalance = createExample(TestedComponent, { - transactions: [exampleData.withdraw, exampleData.deposit], - balances: [ - { - available: "USD:0", - pendingIncoming: "USD:0", - pendingOutgoing: "USD:0", - hasPendingTransactions: false, - requiresUserInput: false, - }, - ], -}); +export const TwoTransactionsAndZeroBalance = tests.createExample( + TestedComponent, + { + transactions: [exampleData.withdraw, exampleData.deposit], + balances: [ + { + available: "USD:0", + pendingIncoming: "USD:0", + pendingOutgoing: "USD:0", + hasPendingTransactions: false, + requiresUserInput: false, + }, + ], + }, +); -export const OneTransactionPending = createExample(TestedComponent, { +export const OneTransactionPending = tests.createExample(TestedComponent, { transactions: [ { ...exampleData.withdraw, @@ -222,7 +228,7 @@ export const OneTransactionPending = createExample(TestedComponent, { ], }); -export const SomeTransactions = createExample(TestedComponent, { +export const SomeTransactions = tests.createExample(TestedComponent, { transactions: [ exampleData.withdraw, exampleData.payment, @@ -251,7 +257,7 @@ export const SomeTransactions = createExample(TestedComponent, { ], }); -export const SomeTransactionsWithTwoCurrencies = createExample( +export const SomeTransactionsWithTwoCurrencies = tests.createExample( TestedComponent, { transactions: [ @@ -283,7 +289,7 @@ export const SomeTransactionsWithTwoCurrencies = createExample( }, ); -export const FiveOfficialCurrencies = createExample(TestedComponent, { +export const FiveOfficialCurrencies = tests.createExample(TestedComponent, { transactions: [exampleData.withdraw], balances: [ { @@ -324,7 +330,7 @@ export const FiveOfficialCurrencies = createExample(TestedComponent, { ], }); -export const FiveOfficialCurrenciesWithHighValue = createExample( +export const FiveOfficialCurrenciesWithHighValue = tests.createExample( TestedComponent, { transactions: [exampleData.withdraw], @@ -368,7 +374,7 @@ export const FiveOfficialCurrenciesWithHighValue = createExample( }, ); -export const PeerToPeer = createExample(TestedComponent, { +export const PeerToPeer = tests.createExample(TestedComponent, { transactions: [ exampleData.pull_credit, exampleData.pull_debit, |