diff options
Diffstat (limited to 'packages/taler-harness/src/integrationtests')
| -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,      {},    ); | 
