diff options
author | Florian Dold <florian@dold.me> | 2023-08-24 18:29:54 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-08-24 18:30:03 +0200 |
commit | 6cc3fb3d0466e89b67be271009a2fc95f3ed41ca (patch) | |
tree | fc21999997bcdbed6c66dc2970dfc473a85bfd37 /packages/taler-harness/src/integrationtests/test-withdrawal-manual.ts | |
parent | f5596767e1ad8f6461a6e64d61519783928624d2 (diff) | |
download | wallet-core-6cc3fb3d0466e89b67be271009a2fc95f3ed41ca.tar.xz |
harness: modernize some tests
Diffstat (limited to 'packages/taler-harness/src/integrationtests/test-withdrawal-manual.ts')
-rw-r--r-- | packages/taler-harness/src/integrationtests/test-withdrawal-manual.ts | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-withdrawal-manual.ts b/packages/taler-harness/src/integrationtests/test-withdrawal-manual.ts index a356a5c1a..d49235f89 100644 --- a/packages/taler-harness/src/integrationtests/test-withdrawal-manual.ts +++ b/packages/taler-harness/src/integrationtests/test-withdrawal-manual.ts @@ -17,14 +17,14 @@ /** * Imports. */ -import { GlobalTestState } from "../harness/harness.js"; -import { createSimpleTestkudosEnvironment } from "../harness/helpers.js"; +import { AbsoluteTime, Logger, j2s } from "@gnu-taler/taler-util"; import { + BankAccessApiClient, WalletApiOperation, - BankApi, WireGatewayApiClient, } from "@gnu-taler/taler-wallet-core"; -import { AbsoluteTime, j2s, Logger } from "@gnu-taler/taler-util"; +import { GlobalTestState } from "../harness/harness.js"; +import { createSimpleTestkudosEnvironmentV2 } from "../harness/helpers.js"; const logger = new Logger("test-withdrawal-manual.ts"); @@ -34,14 +34,19 @@ const logger = new Logger("test-withdrawal-manual.ts"); export async function runWithdrawalManualTest(t: GlobalTestState) { // Set up test environment - const { wallet, bank, exchange, exchangeBankAccount } = - await createSimpleTestkudosEnvironment(t); + const { walletClient, bank, exchange, exchangeBankAccount } = + await createSimpleTestkudosEnvironmentV2(t); // Create a withdrawal operation - const user = await BankApi.createRandomBankUser(bank); + const bankAccessApiClient = new BankAccessApiClient({ + baseUrl: bank.bankAccessApiBaseUrl, + allowHttp: true, + }); + + const user = await bankAccessApiClient.createRandomBankUser(); - await wallet.client.call(WalletApiOperation.AddExchange, { + await walletClient.call(WalletApiOperation.AddExchange, { exchangeBaseUrl: exchange.baseUrl, }); @@ -50,7 +55,7 @@ export async function runWithdrawalManualTest(t: GlobalTestState) { logger.info("starting AcceptManualWithdrawal request"); // We expect this to return immediately. - const wres = await wallet.client.call( + const wres = await walletClient.call( WalletApiOperation.AcceptManualWithdrawal, { exchangeBaseUrl: exchange.baseUrl, @@ -84,11 +89,11 @@ export async function runWithdrawalManualTest(t: GlobalTestState) { await exchange.runWirewatchOnce(); - await wallet.runUntilDone(); + await walletClient.call(WalletApiOperation.TestingWaitTransactionsFinal, {}); // Check balance - const balResp = await wallet.client.call(WalletApiOperation.GetBalances, {}); + const balResp = await walletClient.call(WalletApiOperation.GetBalances, {}); t.assertAmountEquals("TESTKUDOS:9.72", balResp.balances[0].available); await t.shutdown(); |