diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/ProviderDetail.stories.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/ProviderDetail.stories.tsx | 97 |
1 files changed, 52 insertions, 45 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/ProviderDetail.stories.tsx b/packages/taler-wallet-webextension/src/wallet/ProviderDetail.stories.tsx index 98c68e6bd..08f26438f 100644 --- a/packages/taler-wallet-webextension/src/wallet/ProviderDetail.stories.tsx +++ b/packages/taler-wallet-webextension/src/wallet/ProviderDetail.stories.tsx @@ -21,7 +21,7 @@ import { TalerProtocolTimestamp } from "@gnu-taler/taler-util"; import { ProviderPaymentType } from "@gnu-taler/taler-wallet-core"; -import { createExample } from "../test-utils.js"; +import { tests } from "@gnu-taler/web-util/lib/index.browser"; import { ProviderView as TestedComponent } from "./ProviderDetailPage.js"; export default { @@ -34,7 +34,7 @@ export default { }, }; -export const Active = createExample(TestedComponent, { +export const Active = tests.createExample(TestedComponent, { info: { active: true, name: "sync.demo", @@ -58,7 +58,7 @@ export const Active = createExample(TestedComponent, { }, }); -export const ActiveErrorSync = createExample(TestedComponent, { +export const ActiveErrorSync = tests.createExample(TestedComponent, { info: { active: true, name: "sync.demo", @@ -79,6 +79,7 @@ export const ActiveErrorSync = createExample(TestedComponent, { lastError: { code: 2002, details: "details", + when: new Date().toISOString(), hint: "error hint from the server", message: "message", }, @@ -90,34 +91,37 @@ export const ActiveErrorSync = createExample(TestedComponent, { }, }); -export const ActiveBackupProblemUnreadable = createExample(TestedComponent, { - info: { - active: true, - name: "sync.demo", - syncProviderBaseUrl: "http://sync.taler:9967/", - lastSuccessfulBackupTimestamp: - TalerProtocolTimestamp.fromSeconds(1625063925), - paymentProposalIds: [ - "43Q5WWRJPNS4SE9YKS54H9THDS94089EDGXW9EHBPN6E7M184XEG", - ], - paymentStatus: { - type: ProviderPaymentType.Paid, - paidUntil: { - t_ms: 1656599921000, +export const ActiveBackupProblemUnreadable = tests.createExample( + TestedComponent, + { + info: { + active: true, + name: "sync.demo", + syncProviderBaseUrl: "http://sync.taler:9967/", + lastSuccessfulBackupTimestamp: + TalerProtocolTimestamp.fromSeconds(1625063925), + paymentProposalIds: [ + "43Q5WWRJPNS4SE9YKS54H9THDS94089EDGXW9EHBPN6E7M184XEG", + ], + paymentStatus: { + type: ProviderPaymentType.Paid, + paidUntil: { + t_ms: 1656599921000, + }, + }, + backupProblem: { + type: "backup-unreadable", + }, + terms: { + annualFee: "EUR:1", + storageLimitInMegabytes: 16, + supportedProtocolVersion: "0.0", }, - }, - backupProblem: { - type: "backup-unreadable", - }, - terms: { - annualFee: "EUR:1", - storageLimitInMegabytes: 16, - supportedProtocolVersion: "0.0", }, }, -}); +); -export const ActiveBackupProblemDevice = createExample(TestedComponent, { +export const ActiveBackupProblemDevice = tests.createExample(TestedComponent, { info: { active: true, name: "sync.demo", @@ -149,7 +153,7 @@ export const ActiveBackupProblemDevice = createExample(TestedComponent, { }, }); -export const InactiveUnpaid = createExample(TestedComponent, { +export const InactiveUnpaid = tests.createExample(TestedComponent, { info: { active: false, name: "sync.demo", @@ -166,25 +170,28 @@ export const InactiveUnpaid = createExample(TestedComponent, { }, }); -export const InactiveInsufficientBalance = createExample(TestedComponent, { - info: { - active: false, - name: "sync.demo", - syncProviderBaseUrl: "http://sync.demo.taler.net/", - paymentProposalIds: [], - paymentStatus: { - type: ProviderPaymentType.InsufficientBalance, - amount: "EUR:123", - }, - terms: { - annualFee: "EUR:0.1", - storageLimitInMegabytes: 16, - supportedProtocolVersion: "0.0", +export const InactiveInsufficientBalance = tests.createExample( + TestedComponent, + { + info: { + active: false, + name: "sync.demo", + syncProviderBaseUrl: "http://sync.demo.taler.net/", + paymentProposalIds: [], + paymentStatus: { + type: ProviderPaymentType.InsufficientBalance, + amount: "EUR:123", + }, + terms: { + annualFee: "EUR:0.1", + storageLimitInMegabytes: 16, + supportedProtocolVersion: "0.0", + }, }, }, -}); +); -export const InactivePending = createExample(TestedComponent, { +export const InactivePending = tests.createExample(TestedComponent, { info: { active: false, name: "sync.demo", @@ -202,7 +209,7 @@ export const InactivePending = createExample(TestedComponent, { }, }); -export const ActiveTermsChanged = createExample(TestedComponent, { +export const ActiveTermsChanged = tests.createExample(TestedComponent, { info: { active: true, name: "sync.demo", |