aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/wallet/Settings.stories.tsx
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-01-09 20:20:09 -0300
committerSebastian <sebasjm@gmail.com>2023-01-09 20:20:09 -0300
commit4a781bd0dd8828ce152f6ab2c3f1bbd6b5e826f7 (patch)
tree5c16976f99eb973ff62d78ed64107ca01df57b99 /packages/taler-wallet-webextension/src/wallet/Settings.stories.tsx
parent8a70edb2f8e235c3462127b0aa4e1b65aa1aee0b (diff)
downloadwallet-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/Settings.stories.tsx')
-rw-r--r--packages/taler-wallet-webextension/src/wallet/Settings.stories.tsx97
1 files changed, 53 insertions, 44 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/Settings.stories.tsx b/packages/taler-wallet-webextension/src/wallet/Settings.stories.tsx
index 04b7f3e09..53bc577d4 100644
--- a/packages/taler-wallet-webextension/src/wallet/Settings.stories.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/Settings.stories.tsx
@@ -19,7 +19,7 @@
* @author Sebastian Javier Marchano (sebasjm)
*/
-import { createExample } from "../test-utils.js";
+import { tests } from "@gnu-taler/web-util/lib/index.browser";
import { SettingsView as TestedComponent } from "./Settings.js";
export default {
@@ -45,7 +45,7 @@ const version = {
},
};
-export const AllOff = createExample(TestedComponent, {
+export const AllOff = tests.createExample(TestedComponent, {
deviceName: "this-is-the-device-name",
devModeToggle: { value: false, button: {} },
autoOpenToggle: { value: false, button: {} },
@@ -54,7 +54,7 @@ export const AllOff = createExample(TestedComponent, {
...version,
});
-export const OneChecked = createExample(TestedComponent, {
+export const OneChecked = tests.createExample(TestedComponent, {
deviceName: "this-is-the-device-name",
devModeToggle: { value: false, button: {} },
autoOpenToggle: { value: false, button: {} },
@@ -63,7 +63,7 @@ export const OneChecked = createExample(TestedComponent, {
...version,
});
-export const WithOneExchange = createExample(TestedComponent, {
+export const WithOneExchange = tests.createExample(TestedComponent, {
deviceName: "this-is-the-device-name",
devModeToggle: { value: false, button: {} },
autoOpenToggle: { value: false, button: {} },
@@ -85,45 +85,54 @@ export const WithOneExchange = createExample(TestedComponent, {
...version,
});
-export const WithExchangeInDifferentState = createExample(TestedComponent, {
- deviceName: "this-is-the-device-name",
- devModeToggle: { value: false, button: {} },
- autoOpenToggle: { value: false, button: {} },
- clipboardToggle: { value: false, button: {} },
- setDeviceName: () => Promise.resolve(),
- knownExchanges: [
- {
- currency: "USD",
- exchangeBaseUrl: "http://exchange1.taler",
- tos: {
- currentVersion: "1",
- acceptedVersion: "1",
- content: "content of tos",
- contentType: "text/plain",
- },
- paytoUris: ["payto://x-taler-bank/bank.rpi.sebasjm.com/exchangeminator"],
- },
- {
- currency: "USD",
- exchangeBaseUrl: "http://exchange2.taler",
- tos: {
- currentVersion: "2",
- acceptedVersion: "1",
- content: "content of tos",
- contentType: "text/plain",
+export const WithExchangeInDifferentState = tests.createExample(
+ TestedComponent,
+ {
+ deviceName: "this-is-the-device-name",
+ devModeToggle: { value: false, button: {} },
+ autoOpenToggle: { value: false, button: {} },
+ clipboardToggle: { value: false, button: {} },
+ setDeviceName: () => Promise.resolve(),
+ knownExchanges: [
+ {
+ currency: "USD",
+ exchangeBaseUrl: "http://exchange1.taler",
+ tos: {
+ currentVersion: "1",
+ acceptedVersion: "1",
+ content: "content of tos",
+ contentType: "text/plain",
+ },
+ paytoUris: [
+ "payto://x-taler-bank/bank.rpi.sebasjm.com/exchangeminator",
+ ],
},
- paytoUris: ["payto://x-taler-bank/bank.rpi.sebasjm.com/exchangeminator"],
- } as any, //TODO: complete with auditors, wireInfo and denominations
- {
- currency: "USD",
- exchangeBaseUrl: "http://exchange3.taler",
- tos: {
- currentVersion: "1",
- content: "content of tos",
- contentType: "text/plain",
+ {
+ currency: "USD",
+ exchangeBaseUrl: "http://exchange2.taler",
+ tos: {
+ currentVersion: "2",
+ acceptedVersion: "1",
+ content: "content of tos",
+ contentType: "text/plain",
+ },
+ paytoUris: [
+ "payto://x-taler-bank/bank.rpi.sebasjm.com/exchangeminator",
+ ],
+ } as any, //TODO: complete with auditors, wireInfo and denominations
+ {
+ currency: "USD",
+ exchangeBaseUrl: "http://exchange3.taler",
+ tos: {
+ currentVersion: "1",
+ content: "content of tos",
+ contentType: "text/plain",
+ },
+ paytoUris: [
+ "payto://x-taler-bank/bank.rpi.sebasjm.com/exchangeminator",
+ ],
},
- paytoUris: ["payto://x-taler-bank/bank.rpi.sebasjm.com/exchangeminator"],
- },
- ],
- ...version,
-});
+ ],
+ ...version,
+ },
+);