diff options
author | Florian Dold <florian@dold.me> | 2022-10-31 17:18:16 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-10-31 17:18:16 +0100 |
commit | 0e7a0741c67ef788523eb26afa36105a49405f68 (patch) | |
tree | 74fa0dfc5451cd1ccb809319801b86c258c249f8 /packages/taler-wallet-webextension | |
parent | 5a91fbe2b76dcb6d14fa0c1fa32839133445d512 (diff) |
-type fixesv0.9.0-dev.31
Diffstat (limited to 'packages/taler-wallet-webextension')
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/Deposit/state.ts | 4 | ||||
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/Deposit/test.ts | 26 |
2 files changed, 15 insertions, 15 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Deposit/state.ts b/packages/taler-wallet-webextension/src/cta/Deposit/state.ts index ba7bd147b..77e918ca9 100644 --- a/packages/taler-wallet-webextension/src/cta/Deposit/state.ts +++ b/packages/taler-wallet-webextension/src/cta/Deposit/state.ts @@ -61,8 +61,8 @@ export function useComponentState( }, fee: Amounts.sub(deposit.totalDepositCost, deposit.effectiveDepositAmount) .amount, - cost: deposit.totalDepositCost, - effective: deposit.effectiveDepositAmount, + cost: Amounts.parseOrThrow(deposit.totalDepositCost), + effective: Amounts.parseOrThrow(deposit.effectiveDepositAmount), cancel, }; } diff --git a/packages/taler-wallet-webextension/src/cta/Deposit/test.ts b/packages/taler-wallet-webextension/src/cta/Deposit/test.ts index f628b3287..a5bfed4a8 100644 --- a/packages/taler-wallet-webextension/src/cta/Deposit/test.ts +++ b/packages/taler-wallet-webextension/src/cta/Deposit/test.ts @@ -38,11 +38,9 @@ describe("Deposit CTA states", () => { onSuccess: async () => { null; }, - } + }; const { pullLastResultOrThrow, waitForStateUpdate, assertNoPendingUpdate } = - mountHook(() => - useComponentState(props, mock), - ); + mountHook(() => useComponentState(props, mock)); { const { status } = pullLastResultOrThrow(); @@ -62,15 +60,19 @@ describe("Deposit CTA states", () => { expect(error.message).eq("ERROR_NO-URI-FOR-DEPOSIT"); } await assertNoPendingUpdate(); - expect(handler.getCallingQueueState()).eq("empty") + expect(handler.getCallingQueueState()).eq("empty"); }); it("should be ready after loading", async () => { const { handler, mock } = createWalletApiMock(); - handler.addWalletCallResponse(WalletApiOperation.PrepareDeposit, undefined, { - effectiveDepositAmount: Amounts.parseOrThrow("EUR:1"), - totalDepositCost: Amounts.parseOrThrow("EUR:1.2"), - }); + handler.addWalletCallResponse( + WalletApiOperation.PrepareDeposit, + undefined, + { + effectiveDepositAmount: "EUR:1", + totalDepositCost: "EUR:1.2", + }, + ); const props = { talerDepositUri: "payto://refund/asdasdas", amountStr: "EUR:1", @@ -80,12 +82,10 @@ describe("Deposit CTA states", () => { onSuccess: async () => { null; }, - } + }; const { pullLastResultOrThrow, waitForStateUpdate, assertNoPendingUpdate } = - mountHook(() => - useComponentState(props, mock), - ); + mountHook(() => useComponentState(props, mock)); { const { status } = pullLastResultOrThrow(); |