diff options
author | Sebastian <sebasjm@gmail.com> | 2022-09-20 16:04:51 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-09-20 16:05:59 -0300 |
commit | 52ec740c825d4e94fd59ef0a5cd8e8b73f4dfc06 (patch) | |
tree | dd65f9852005097c2cd8975b14ccbd198bef57e8 /packages/taler-wallet-webextension/src/cta/Withdraw/test.ts | |
parent | a5525eab1e96d5b08fbb6442275b1e92f7f8d806 (diff) | |
download | wallet-core-52ec740c825d4e94fd59ef0a5cd8e8b73f4dfc06.tar.xz |
new compose feature: sub-states
implemented in withdraw page, WIP
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Withdraw/test.ts')
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/Withdraw/test.ts | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts b/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts index f614c1c8c..5c62671fe 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts +++ b/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts @@ -29,6 +29,7 @@ import { ExchangeWithdrawDetails } from "@gnu-taler/taler-wallet-core"; import { expect } from "chai"; import { mountHook } from "../../test-utils.js"; import { useComponentStateFromURI } from "./state.js"; +import * as wxApi from "../../wxApi.js"; const exchanges: ExchangeFullDetails[] = [ { @@ -92,7 +93,7 @@ describe("Withdraw CTA states", () => { { const { status, error } = getLastResultOrThrow(); - if (status != "loading-uri") expect.fail(); + if (status != "loading-error") expect.fail(); if (!error) expect.fail(); if (!error.hasError) expect.fail(); if (error.operational) expect.fail(); @@ -127,7 +128,7 @@ describe("Withdraw CTA states", () => { { const { status } = getLastResultOrThrow(); - expect(status).equals("loading"); + expect(status).equals("loading", "1"); } await waitNextUpdate(); @@ -135,13 +136,9 @@ describe("Withdraw CTA states", () => { { const { status, error } = getLastResultOrThrow(); - expect(status).equals("loading-exchange"); + expect(status).equals("no-exchange", "3"); - expect(error).deep.equals({ - hasError: true, - operational: false, - message: "ERROR_NO-DEFAULT-EXCHANGE", - }); + expect(error).undefined; } await assertNoPendingUpdate(); @@ -169,10 +166,10 @@ describe("Withdraw CTA states", () => { }), getExchangeWithdrawalInfo: async (): Promise<ExchangeWithdrawDetails> => - ({ - withdrawalAmountRaw: "ARS:2", - withdrawalAmountEffective: "ARS:2", - } as any), + ({ + withdrawalAmountRaw: "ARS:2", + withdrawalAmountEffective: "ARS:2", + } as any), getExchangeTos: async (): Promise<GetExchangeTosResult> => ({ contentType: "text", content: "just accept", @@ -246,10 +243,10 @@ describe("Withdraw CTA states", () => { }), getExchangeWithdrawalInfo: async (): Promise<ExchangeWithdrawDetails> => - ({ - withdrawalAmountRaw: "ARS:2", - withdrawalAmountEffective: "ARS:2", - } as any), + ({ + withdrawalAmountRaw: "ARS:2", + withdrawalAmountEffective: "ARS:2", + } as any), getExchangeTos: async (): Promise<GetExchangeTosResult> => ({ contentType: "text", content: "just accept", |