diff options
author | Sebastian <sebasjm@gmail.com> | 2022-09-16 16:03:58 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-09-16 16:03:58 -0300 |
commit | 59d235e8d29159bc8caccf8bee6a2bca8b0b90dc (patch) | |
tree | 551261c860b1989dc0b1a05ddcfd53d20e561626 /packages/taler-wallet-webextension/src/cta/Refund/test.ts | |
parent | 6ddb2de84245ae3914c92b2b2eb7399e7f04500e (diff) | |
download | wallet-core-59d235e8d29159bc8caccf8bee6a2bca8b0b90dc.tar.xz |
redirect after success #7357
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Refund/test.ts')
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/Refund/test.ts | 97 |
1 files changed, 51 insertions, 46 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Refund/test.ts b/packages/taler-wallet-webextension/src/cta/Refund/test.ts index 04d3e0d5f..09470b7f6 100644 --- a/packages/taler-wallet-webextension/src/cta/Refund/test.ts +++ b/packages/taler-wallet-webextension/src/cta/Refund/test.ts @@ -40,6 +40,7 @@ describe("Refund CTA states", () => { cancel: async () => { null; }, + onSuccess: async () => { null; }, }, { prepareRefund: async () => ({}), @@ -79,25 +80,26 @@ describe("Refund CTA states", () => { cancel: async () => { null; }, + onSuccess: async () => { null; }, }, { prepareRefund: async () => - ({ - effectivePaid: "EUR:2", - awaiting: "EUR:2", - gone: "EUR:0", - granted: "EUR:0", - pending: false, - proposalId: "1", - info: { - contractTermsHash: "123", - merchant: { - name: "the merchant name", - }, - orderId: "orderId1", - summary: "the summary", + ({ + effectivePaid: "EUR:2", + awaiting: "EUR:2", + gone: "EUR:0", + granted: "EUR:0", + pending: false, + proposalId: "1", + info: { + contractTermsHash: "123", + merchant: { + name: "the merchant name", }, - } as PrepareRefundResult as any), + orderId: "orderId1", + summary: "the summary", + }, + } as PrepareRefundResult as any), applyRefund: async () => ({}), onUpdateNotification: async () => ({}), } as any, @@ -136,25 +138,26 @@ describe("Refund CTA states", () => { cancel: async () => { null; }, + onSuccess: async () => { null; }, }, { prepareRefund: async () => - ({ - effectivePaid: "EUR:2", - awaiting: "EUR:2", - gone: "EUR:0", - granted: "EUR:0", - pending: false, - proposalId: "1", - info: { - contractTermsHash: "123", - merchant: { - name: "the merchant name", - }, - orderId: "orderId1", - summary: "the summary", + ({ + effectivePaid: "EUR:2", + awaiting: "EUR:2", + gone: "EUR:0", + granted: "EUR:0", + pending: false, + proposalId: "1", + info: { + contractTermsHash: "123", + merchant: { + name: "the merchant name", }, - } as PrepareRefundResult as any), + orderId: "orderId1", + summary: "the summary", + }, + } as PrepareRefundResult as any), applyRefund: async () => ({}), onUpdateNotification: async () => ({}), } as any, @@ -220,25 +223,27 @@ describe("Refund CTA states", () => { cancel: async () => { null; }, + onSuccess: async () => { null; }, + }, { prepareRefund: async () => - ({ - awaiting: Amounts.stringify(awaiting), - effectivePaid: "EUR:2", - gone: "EUR:0", - granted: Amounts.stringify(granted), - pending, - proposalId: "1", - info: { - contractTermsHash: "123", - merchant: { - name: "the merchant name", - }, - orderId: "orderId1", - summary: "the summary", + ({ + awaiting: Amounts.stringify(awaiting), + effectivePaid: "EUR:2", + gone: "EUR:0", + granted: Amounts.stringify(granted), + pending, + proposalId: "1", + info: { + contractTermsHash: "123", + merchant: { + name: "the merchant name", }, - } as PrepareRefundResult as any), + orderId: "orderId1", + summary: "the summary", + }, + } as PrepareRefundResult as any), applyRefund: async () => ({}), onUpdateNotification: subscriptions.saveSubscription, } as any, @@ -286,7 +291,7 @@ describe("Refund CTA states", () => { { const state = getLastResultOrThrow(); - if (state.status !== "completed") expect.fail("3"); + if (state.status !== "ready") expect.fail("3"); if (state.error) expect.fail(); expect(state.merchantName).eq("the merchant name"); expect(state.products).undefined; |