diff options
author | Sebastian <sebasjm@gmail.com> | 2021-11-24 08:57:26 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2021-11-24 08:58:49 -0300 |
commit | 0bfd4523b3408d9c841a1f25fd9ec86e81d6dd8f (patch) | |
tree | f453943d92fefbd04b9222a5f25f2c9563c239f3 /packages/taler-wallet-webextension/src/cta/Withdraw.stories.tsx | |
parent | f07436aa4910114a514235fb17879411dae0a555 (diff) | |
download | wallet-core-0bfd4523b3408d9c841a1f25fd9ec86e81d6dd8f.tar.xz |
adding tos information in settings and return to manual withdraw when adding an exchange
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Withdraw.stories.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/Withdraw.stories.tsx | 170 |
1 files changed, 37 insertions, 133 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw.stories.tsx b/packages/taler-wallet-webextension/src/cta/Withdraw.stories.tsx index fbbecd6f3..3915dc126 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 { amountFractionalBase } from "@gnu-taler/taler-util"; +import { amountFractionalBase, ExchangeListItem } from "@gnu-taler/taler-util"; import { createExample } from "../test-utils"; import { termsHtml, termsPdf, termsPlain, termsXml } from "./termsExample"; import { View as TestedComponent } from "./Withdraw"; @@ -32,24 +32,38 @@ export default { }, }; -export const NewTerms = createExample(TestedComponent, { - knownExchanges: [ - { - currency: "USD", - exchangeBaseUrl: "exchange.demo.taler.net", - paytoUris: ["asd"], +const exchangeList: ExchangeListItem[] = [ + { + currency: "USD", + exchangeBaseUrl: "exchange.demo.taler.net", + tos: { + currentVersion: "1", + acceptedVersion: "1", + content: "terms of service content", + contentType: "text/plain", }, - { - currency: "USD", - exchangeBaseUrl: "exchange.test.taler.net", - paytoUris: ["asd"], + paytoUris: ["asd"], + }, + { + currency: "USD", + exchangeBaseUrl: "exchange.test.taler.net", + tos: { + currentVersion: "1", + acceptedVersion: "1", + content: "terms of service content", + contentType: "text/plain", }, - ], + paytoUris: ["asd"], + }, +]; + +export const NewTerms = createExample(TestedComponent, { + knownExchanges: exchangeList, exchangeBaseUrl: "exchange.demo.taler.net", withdrawalFee: { currency: "USD", fraction: 0, - value: 0, + value: 1, }, amount: { currency: "USD", @@ -71,18 +85,7 @@ export const NewTerms = createExample(TestedComponent, { }); export const TermsReviewingPLAIN = createExample(TestedComponent, { - knownExchanges: [ - { - currency: "USD", - exchangeBaseUrl: "exchange.demo.taler.net", - paytoUris: ["asd"], - }, - { - currency: "USD", - exchangeBaseUrl: "exchange.test.taler.net", - paytoUris: ["asd"], - }, - ], + knownExchanges: exchangeList, exchangeBaseUrl: "exchange.demo.taler.net", withdrawalFee: { currency: "USD", @@ -110,18 +113,7 @@ export const TermsReviewingPLAIN = createExample(TestedComponent, { }); export const TermsReviewingHTML = createExample(TestedComponent, { - knownExchanges: [ - { - currency: "USD", - exchangeBaseUrl: "exchange.demo.taler.net", - paytoUris: ["asd"], - }, - { - currency: "USD", - exchangeBaseUrl: "exchange.test.taler.net", - paytoUris: ["asd"], - }, - ], + knownExchanges: exchangeList, exchangeBaseUrl: "exchange.demo.taler.net", withdrawalFee: { currency: "USD", @@ -151,18 +143,7 @@ export const TermsReviewingHTML = createExample(TestedComponent, { }); export const TermsReviewingPDF = createExample(TestedComponent, { - knownExchanges: [ - { - currency: "USD", - exchangeBaseUrl: "exchange.demo.taler.net", - paytoUris: ["asd"], - }, - { - currency: "USD", - exchangeBaseUrl: "exchange.test.taler.net", - paytoUris: ["asd"], - }, - ], + knownExchanges: exchangeList, exchangeBaseUrl: "exchange.demo.taler.net", withdrawalFee: { currency: "USD", @@ -192,18 +173,7 @@ export const TermsReviewingPDF = createExample(TestedComponent, { }); export const TermsReviewingXML = createExample(TestedComponent, { - knownExchanges: [ - { - currency: "USD", - exchangeBaseUrl: "exchange.demo.taler.net", - paytoUris: ["asd"], - }, - { - currency: "USD", - exchangeBaseUrl: "exchange.test.taler.net", - paytoUris: ["asd"], - }, - ], + knownExchanges: exchangeList, exchangeBaseUrl: "exchange.demo.taler.net", withdrawalFee: { currency: "USD", @@ -231,18 +201,7 @@ export const TermsReviewingXML = createExample(TestedComponent, { }); export const NewTermsAccepted = createExample(TestedComponent, { - knownExchanges: [ - { - currency: "USD", - exchangeBaseUrl: "exchange.demo.taler.net", - paytoUris: ["asd"], - }, - { - currency: "USD", - exchangeBaseUrl: "exchange.test.taler.net", - paytoUris: ["asd"], - }, - ], + knownExchanges: exchangeList, exchangeBaseUrl: "exchange.demo.taler.net", withdrawalFee: { currency: "USD", @@ -269,18 +228,7 @@ export const NewTermsAccepted = createExample(TestedComponent, { }); export const TermsShowAgainXML = createExample(TestedComponent, { - knownExchanges: [ - { - currency: "USD", - exchangeBaseUrl: "exchange.demo.taler.net", - paytoUris: ["asd"], - }, - { - currency: "USD", - exchangeBaseUrl: "exchange.test.taler.net", - paytoUris: ["asd"], - }, - ], + knownExchanges: exchangeList, exchangeBaseUrl: "exchange.demo.taler.net", withdrawalFee: { currency: "USD", @@ -309,18 +257,7 @@ export const TermsShowAgainXML = createExample(TestedComponent, { }); export const TermsChanged = createExample(TestedComponent, { - knownExchanges: [ - { - currency: "USD", - exchangeBaseUrl: "exchange.demo.taler.net", - paytoUris: ["asd"], - }, - { - currency: "USD", - exchangeBaseUrl: "exchange.test.taler.net", - paytoUris: ["asd"], - }, - ], + knownExchanges: exchangeList, exchangeBaseUrl: "exchange.demo.taler.net", withdrawalFee: { currency: "USD", @@ -347,18 +284,7 @@ export const TermsChanged = createExample(TestedComponent, { }); export const TermsNotFound = createExample(TestedComponent, { - knownExchanges: [ - { - currency: "USD", - exchangeBaseUrl: "exchange.demo.taler.net", - paytoUris: ["asd"], - }, - { - currency: "USD", - exchangeBaseUrl: "exchange.test.taler.net", - paytoUris: ["asd"], - }, - ], + knownExchanges: exchangeList, exchangeBaseUrl: "exchange.demo.taler.net", withdrawalFee: { currency: "USD", @@ -382,18 +308,7 @@ export const TermsNotFound = createExample(TestedComponent, { }); export const TermsAlreadyAccepted = createExample(TestedComponent, { - knownExchanges: [ - { - currency: "USD", - exchangeBaseUrl: "exchange.demo.taler.net", - paytoUris: ["asd"], - }, - { - currency: "USD", - exchangeBaseUrl: "exchange.test.taler.net", - paytoUris: ["asd"], - }, - ], + knownExchanges: exchangeList, exchangeBaseUrl: "exchange.demo.taler.net", withdrawalFee: { currency: "USD", @@ -417,18 +332,7 @@ export const TermsAlreadyAccepted = createExample(TestedComponent, { }); export const WithoutFee = createExample(TestedComponent, { - knownExchanges: [ - { - currency: "USD", - exchangeBaseUrl: "exchange.demo.taler.net", - paytoUris: ["asd"], - }, - { - currency: "USD", - exchangeBaseUrl: "exchange.test.taler.net", - paytoUris: ["asd"], - }, - ], + knownExchanges: exchangeList, exchangeBaseUrl: "exchange.demo.taler.net", withdrawalFee: { currency: "USD", |