diff options
author | Sebastian <sebasjm@gmail.com> | 2022-11-07 14:38:42 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-11-07 14:38:42 -0300 |
commit | 6f3cd163431fecfa126f740ebfec1b5c5c74f5b7 (patch) | |
tree | ad00931c6dfa427b4f64d89baab7f2711f1864ce /packages/taler-wallet-webextension/src/wallet/DepositPage/test.ts | |
parent | 3eafb64912411dd21696a8896e9314ceb49c1326 (diff) | |
download | wallet-core-6f3cd163431fecfa126f740ebfec1b5c5c74f5b7.tar.xz |
standard Amount field and add more validation (neg values)
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/DepositPage/test.ts')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/DepositPage/test.ts | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/DepositPage/test.ts b/packages/taler-wallet-webextension/src/wallet/DepositPage/test.ts index 9f336ac1a..17e17d185 100644 --- a/packages/taler-wallet-webextension/src/wallet/DepositPage/test.ts +++ b/packages/taler-wallet-webextension/src/wallet/DepositPage/test.ts @@ -167,6 +167,11 @@ describe("DepositPage states", () => { accounts: [ibanPayto], }, ); + handler.addWalletCallResponse( + WalletApiOperation.GetFeeForDeposit, + undefined, + withoutFee(), + ); const { pullLastResultOrThrow, waitForStateUpdate, assertNoPendingUpdate } = mountHook(() => useComponentState(props, mock)); @@ -177,6 +182,11 @@ describe("DepositPage states", () => { } expect(await waitForStateUpdate()).true; + { + const { status } = pullLastResultOrThrow(); + expect(status).equal("loading"); + } + expect(await waitForStateUpdate()).true; { const r = pullLastResultOrThrow(); @@ -219,6 +229,12 @@ describe("DepositPage states", () => { undefined, withoutFee(), ); + + handler.addWalletCallResponse( + WalletApiOperation.GetFeeForDeposit, + undefined, + withoutFee(), + ); handler.addWalletCallResponse( WalletApiOperation.GetFeeForDeposit, undefined, @@ -239,6 +255,12 @@ describe("DepositPage states", () => { } expect(await waitForStateUpdate()).true; + { + const { status } = pullLastResultOrThrow(); + expect(status).equal("loading"); + } + + expect(await waitForStateUpdate()).true; const accountSelected = stringifyPaytoUri(ibanPayto.uri); { @@ -364,6 +386,11 @@ describe("DepositPage states", () => { handler.addWalletCallResponse( WalletApiOperation.GetFeeForDeposit, undefined, + withoutFee(), + ); + handler.addWalletCallResponse( + WalletApiOperation.GetFeeForDeposit, + undefined, withSomeFee(), ); handler.addWalletCallResponse( @@ -381,6 +408,13 @@ describe("DepositPage states", () => { } expect(await waitForStateUpdate()).true; + + { + const { status } = pullLastResultOrThrow(); + expect(status).equal("loading"); + } + + expect(await waitForStateUpdate()).true; const accountSelected = stringifyPaytoUri(ibanPayto.uri); { @@ -409,6 +443,8 @@ describe("DepositPage states", () => { expect(r.depositHandler.onClick).undefined; expect(r.totalFee).deep.eq(Amounts.parseOrThrow(`${currency}:3`)); + expect(r.amount.onInput).not.undefined; + if (!r.amount.onInput) return; r.amount.onInput("10"); } |