diff options
author | Florian Dold <florian@dold.me> | 2023-04-06 12:47:34 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-04-06 12:47:34 +0200 |
commit | 43ae414a55b84b1125c5e4377c6d485ca6c748e2 (patch) | |
tree | 3e2f9ffc272406aa25327f19b9006d020f070658 /packages/taler-harness/src/integrationtests/test-deposit.ts | |
parent | 3cf6d15eae299576eada8b501e5848ef29dad03c (diff) | |
download | wallet-core-43ae414a55b84b1125c5e4377c6d485ca6c748e2.tar.xz |
-re-add missing fields, fix types
Diffstat (limited to 'packages/taler-harness/src/integrationtests/test-deposit.ts')
-rw-r--r-- | packages/taler-harness/src/integrationtests/test-deposit.ts | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-deposit.ts b/packages/taler-harness/src/integrationtests/test-deposit.ts index 24dcbafc0..1b46daf5f 100644 --- a/packages/taler-harness/src/integrationtests/test-deposit.ts +++ b/packages/taler-harness/src/integrationtests/test-deposit.ts @@ -17,11 +17,12 @@ /** * Imports. */ +import { NotificationType, TransactionState } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { GlobalTestState, getPayto } from "../harness/harness.js"; import { - createSimpleTestkudosEnvironment, - withdrawViaBank, + createSimpleTestkudosEnvironmentV2, + withdrawViaBankV2, } from "../harness/helpers.js"; /** @@ -30,16 +31,27 @@ import { export async function runDepositTest(t: GlobalTestState) { // Set up test environment - const { wallet, bank, exchange, merchant } = - await createSimpleTestkudosEnvironment(t); + const { walletClient, bank, exchange } = + await createSimpleTestkudosEnvironmentV2(t); // Withdraw digital cash into the wallet. - await withdrawViaBank(t, { wallet, bank, exchange, amount: "TESTKUDOS:20" }); + const withdrawalResult = await withdrawViaBankV2(t, { + walletClient, + bank, + exchange, + amount: "TESTKUDOS:20", + }); - await wallet.runUntilDone(); + await withdrawalResult.withdrawalFinishedCond; - const { depositGroupId } = await wallet.client.call( + const depositDone = await walletClient.waitForNotificationCond( + (n) => + n.type == NotificationType.TransactionStateTransition && + n.newTxState == TransactionState.Done, + ); + + const depositGroupResult = await walletClient.client.call( WalletApiOperation.CreateDepositGroup, { amount: "TESTKUDOS:10", @@ -47,9 +59,7 @@ export async function runDepositTest(t: GlobalTestState) { }, ); - await wallet.runUntilDone(); - - const transactions = await wallet.client.call( + const transactions = await walletClient.client.call( WalletApiOperation.GetTransactions, {}, ); |