aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-webextension')
-rw-r--r--packages/taler-wallet-webextension/src/cta/Deposit/state.ts4
-rw-r--r--packages/taler-wallet-webextension/src/cta/Deposit/test.ts26
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();