diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Withdraw/stories.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/Withdraw/stories.tsx | 105 |
1 files changed, 92 insertions, 13 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/stories.tsx b/packages/taler-wallet-webextension/src/cta/Withdraw/stories.tsx index df70a5c95..a3127fafc 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw/stories.tsx +++ b/packages/taler-wallet-webextension/src/cta/Withdraw/stories.tsx @@ -19,7 +19,7 @@ * @author Sebastian Javier Marchano (sebasjm) */ -import { ExchangeListItem } from "@gnu-taler/taler-util"; +import { CurrencySpecification, ExchangeListItem } from "@gnu-taler/taler-util"; import * as tests from "@gnu-taler/web-util/testing"; import { nullFunction } from "../../mui/handlers.js"; // import { TermsState } from "../../utils/index.js"; @@ -64,7 +64,7 @@ export const TermsOfServiceNotYetLoaded = tests.createExample(SuccessView, { fraction: 0, value: 1, }, - accounts: [], + chooseCurrencies: [], }); export const WithSomeFee = tests.createExample(SuccessView, { @@ -91,7 +91,7 @@ export const WithSomeFee = tests.createExample(SuccessView, { value: 1, }, doSelectExchange: {}, - accounts: [], + chooseCurrencies: [], }); export const WithoutFee = tests.createExample(SuccessView, { @@ -118,7 +118,7 @@ export const WithoutFee = tests.createExample(SuccessView, { fraction: 0, value: 2, }, - accounts: [], + chooseCurrencies: [], }); export const EditExchangeUntouched = tests.createExample(SuccessView, { @@ -145,7 +145,7 @@ export const EditExchangeUntouched = tests.createExample(SuccessView, { fraction: 0, value: 2, }, - accounts: [], + chooseCurrencies: [], }); export const EditExchangeModified = tests.createExample(SuccessView, { @@ -172,7 +172,7 @@ export const EditExchangeModified = tests.createExample(SuccessView, { fraction: 0, value: 2, }, - accounts: [], + chooseCurrencies: [], }); export const WithAgeRestriction = tests.createExample(SuccessView, { @@ -200,31 +200,110 @@ export const WithAgeRestriction = tests.createExample(SuccessView, { fraction: 0, value: 2, }, - accounts: [], + chooseCurrencies: [], }); -export const WithAlternateCurrencies = tests.createExample(SuccessView, { +export const WithAlternateCurrenciesNETZBON = tests.createExample(SuccessView, { error: undefined, status: "success", chosenAmount: { - currency: "USD", + currency: "NETZBON", value: 2, fraction: 10000000, }, - accounts: [], + chooseCurrencies: ["NETZBON", "EUR"], + selectedCurrency: "NETZBON", doWithdrawal: { onClick: nullFunction }, currentExchange: { - exchangeBaseUrl: "https://exchange.demo.taler.net", + exchangeBaseUrl: "https://exchange.netzbon.ch", tos: {}, } as Partial<ExchangeListItem> as any, withdrawalFee: { - currency: "USD", + currency: "NETZBON", fraction: 10000000, value: 1, }, doSelectExchange: {}, toBeReceived: { - currency: "USD", + currency: "NETZBON", + fraction: 0, + value: 1, + }, +}); + +export const WithAlternateCurrenciesEURO = tests.createExample(SuccessView, { + error: undefined, + status: "success", + chosenAmount: { + currency: "NETZBON", + value: 2, + fraction: 10000000, + }, + chooseCurrencies: ["NETZBON", "EUR"], + selectedCurrency: "EUR", + changeCurrency: () => { }, + conversionInfo: { + spec: { + name: "EUR" + } as CurrencySpecification, + amount: { + currency: "EUR", + fraction: 10000000, + value: 1, + } + }, + doWithdrawal: { onClick: nullFunction }, + currentExchange: { + exchangeBaseUrl: "https://exchange.netzbon.ch", + tos: {}, + } as Partial<ExchangeListItem> as any, + withdrawalFee: { + currency: "NETZBON", + fraction: 10000000, + value: 1, + }, + doSelectExchange: {}, + toBeReceived: { + currency: "NETZBON", + fraction: 0, + value: 1, + }, +}); + +export const WithAlternateCurrenciesEURO11 = tests.createExample(SuccessView, { + error: undefined, + status: "success", + chosenAmount: { + currency: "NETZBON", + value: 2, + fraction: 10000000, + }, + chooseCurrencies: ["NETZBON", "EUR"], + selectedCurrency: "EUR", + changeCurrency: () => { }, + conversionInfo: { + spec: { + name: "EUR" + } as CurrencySpecification, + amount: { + currency: "EUR", + fraction: 10000000, + value: 2, + } + }, + doWithdrawal: { onClick: nullFunction }, + currentExchange: { + exchangeBaseUrl: "https://exchange.netzbon.ch", + tos: {}, + } as Partial<ExchangeListItem> as any, + withdrawalFee: { + currency: "NETZBON", + fraction: 10000000, + value: 1, + }, + doSelectExchange: {}, + toBeReceived: { + currency: "NETZBON", fraction: 0, value: 1, }, |