diff options
author | Sebastian <sebasjm@gmail.com> | 2022-01-04 17:06:17 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-01-04 17:06:24 -0300 |
commit | 9f8139e09b21ec12f9b9ba4926ea80557698c559 (patch) | |
tree | dba5aacf50e89176bee35cfdd1002cc61c3f52e5 /packages/taler-wallet-webextension/src/cta/Withdraw.stories.tsx | |
parent | 2e71117f59e0ae6106930e705ae6a54a9839281b (diff) | |
download | wallet-core-9f8139e09b21ec12f9b9ba4926ea80557698c559.tar.xz |
replace jest with mocha
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Withdraw.stories.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/Withdraw.stories.tsx | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw.stories.tsx b/packages/taler-wallet-webextension/src/cta/Withdraw.stories.tsx index 3915dc126..3f548366a 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw.stories.tsx +++ b/packages/taler-wallet-webextension/src/cta/Withdraw.stories.tsx @@ -24,12 +24,16 @@ import { createExample } from "../test-utils"; import { termsHtml, termsPdf, termsPlain, termsXml } from "./termsExample"; import { View as TestedComponent } from "./Withdraw"; +function parseFromString(s: string): Document { + if (typeof window === "undefined") { + return {} as Document; + } + return new window.DOMParser().parseFromString(s, "text/xml"); +} + export default { title: "cta/withdraw", component: TestedComponent, - argTypes: { - onSwitchExchange: { action: "onRetry" }, - }, }; const exchangeList: ExchangeListItem[] = [ @@ -77,7 +81,7 @@ export const NewTerms = createExample(TestedComponent, { terms: { content: { type: "xml", - document: new DOMParser().parseFromString(termsXml, "text/xml"), + document: parseFromString(termsXml), }, status: "new", version: "", @@ -192,7 +196,7 @@ export const TermsReviewingXML = createExample(TestedComponent, { terms: { content: { type: "xml", - document: new DOMParser().parseFromString(termsXml, "text/xml"), + document: parseFromString(termsXml), }, status: "new", version: "", @@ -219,7 +223,7 @@ export const NewTermsAccepted = createExample(TestedComponent, { terms: { content: { type: "xml", - document: new DOMParser().parseFromString(termsXml, "text/xml"), + document: parseFromString(termsXml), }, status: "new", version: "", @@ -247,7 +251,7 @@ export const TermsShowAgainXML = createExample(TestedComponent, { terms: { content: { type: "xml", - document: new DOMParser().parseFromString(termsXml, "text/xml"), + document: parseFromString(termsXml), }, version: "", status: "new", @@ -276,7 +280,7 @@ export const TermsChanged = createExample(TestedComponent, { terms: { content: { type: "xml", - document: new DOMParser().parseFromString(termsXml, "text/xml"), + document: parseFromString(termsXml), }, version: "", status: "changed", @@ -351,7 +355,7 @@ export const WithoutFee = createExample(TestedComponent, { terms: { content: { type: "xml", - document: new DOMParser().parseFromString(termsXml, "text/xml"), + document: parseFromString(termsXml), }, status: "accepted", version: "", |