diff options
author | Florian Dold <florian@dold.me> | 2024-01-19 14:35:00 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-01-19 14:46:07 +0100 |
commit | ef4cc1a1ca568cf9e43964ca20bfc0b8c07a41e5 (patch) | |
tree | a38370305e43f0c17e9cde1653dadda5ef7e5217 /packages/taler-harness/src | |
parent | 2f50b3880edb60db88397fb1c3b5c2f601f6a629 (diff) | |
download | wallet-core-ef4cc1a1ca568cf9e43964ca20bfc0b8c07a41e5.tar.xz |
wallet-core: fix bugs.taler.net/n/7836
The test case for expired refunds now does more checks.
A DB query bug for refund items was also fixed.
Diffstat (limited to 'packages/taler-harness/src')
-rw-r--r-- | packages/taler-harness/src/integrationtests/test-refund-gone.ts | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-refund-gone.ts b/packages/taler-harness/src/integrationtests/test-refund-gone.ts index d50919934..60098cc9b 100644 --- a/packages/taler-harness/src/integrationtests/test-refund-gone.ts +++ b/packages/taler-harness/src/integrationtests/test-refund-gone.ts @@ -21,6 +21,8 @@ import { AbsoluteTime, Duration, MerchantApiClient, + TransactionMajorState, + TransactionType, durationFromSpec, } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; @@ -32,7 +34,8 @@ import { } from "../harness/helpers.js"; /** - * Run test for basic, bank-integrated withdrawal. + * Test wallet behavior when a refund expires before the wallet + * can claim it. */ export async function runRefundGoneTest(t: GlobalTestState) { // Set up test environment @@ -102,7 +105,7 @@ export async function runRefundGoneTest(t: GlobalTestState) { await applyTimeTravelV2( Duration.toMilliseconds(Duration.fromSpec({ hours: 1 })), - { exchange, walletClient: walletClient }, + { exchange, merchant, walletClient: walletClient }, ); await exchange.runAggregatorOnce(); @@ -128,7 +131,10 @@ export async function runRefundGoneTest(t: GlobalTestState) { const r3 = await walletClient.call(WalletApiOperation.GetTransactions, {}); console.log(JSON.stringify(r3, undefined, 2)); - await t.shutdown(); + const refundTx = r3.transactions[2]; + + t.assertDeepEqual(refundTx.type, TransactionType.Refund); + t.assertDeepEqual(refundTx.txState.major, TransactionMajorState.Failed); } runRefundGoneTest.suites = ["wallet"]; |