diff options
author | Florian Dold <florian@dold.me> | 2024-10-22 15:06:59 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-10-22 15:07:09 +0200 |
commit | 09bae316456f49c6bac2aca6185483e1e7ab2d5a (patch) | |
tree | ae5a4ad15c0f6f13adbbb8d3c54b15a028dd615c /packages/taler-harness/src | |
parent | 311ca8cb7ba7cafa8f9baeb904775d6f1392935f (diff) |
wallet-core,harness: docs, test getWithdrawalDetailsForAmount on zero input
Diffstat (limited to 'packages/taler-harness/src')
-rw-r--r-- | packages/taler-harness/src/integrationtests/test-withdrawal-manual.ts | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-withdrawal-manual.ts b/packages/taler-harness/src/integrationtests/test-withdrawal-manual.ts index 568da1b0c..6f12c4eba 100644 --- a/packages/taler-harness/src/integrationtests/test-withdrawal-manual.ts +++ b/packages/taler-harness/src/integrationtests/test-withdrawal-manual.ts @@ -19,15 +19,15 @@ */ import { AbsoluteTime, - TalerCorebankApiClient, + AmountString, Logger, + ScopeType, WireGatewayApiClient, j2s, - AmountString, } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; -import { GlobalTestState } from "../harness/harness.js"; import { createSimpleTestkudosEnvironmentV3 } from "../harness/environments.js"; +import { GlobalTestState } from "../harness/harness.js"; const logger = new Logger("test-withdrawal-manual.ts"); @@ -50,6 +50,25 @@ export async function runWithdrawalManualTest(t: GlobalTestState) { const tStart = AbsoluteTime.now(); + // Test some getWithdrawalDetailsForAmount requests + { + // Zero should be acceptable + const det = await walletClient.call( + WalletApiOperation.GetWithdrawalDetailsForAmount, + { + amount: "TESTKUDOS:0", + restrictScope: { + type: ScopeType.Exchange, + currency: "TESTKUDOS", + url: exchange.baseUrl, + }, + }, + ); + t.assertAmountEquals(det.amountEffective, "TESTKUDOS:0"); + t.assertAmountEquals(det.amountRaw, "TESTKUDOS:0"); + t.assertDeepEqual(det.numCoins, 0); + } + logger.info("starting AcceptManualWithdrawal request"); // We expect this to return immediately. |