aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-01-22 21:59:01 +0100
committerFlorian Dold <florian@dold.me>2024-01-22 21:59:01 +0100
commitb9e219c02127ec789ae44268d6e9d66ae07e2f83 (patch)
treea0a91620254bcab6d250a8da647465403e4cf58b
parent47f61c1ba38453ddd28abc196b7164d2ffdb1c8a (diff)
downloadwallet-core-b9e219c02127ec789ae44268d6e9d66ae07e2f83.tar.xz
harness: fix payment-share integration test
The test didn't wait for refreshes to settle before doing balance checks
-rw-r--r--packages/taler-harness/src/integrationtests/test-payment-share.ts21
1 files changed, 15 insertions, 6 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-payment-share.ts b/packages/taler-harness/src/integrationtests/test-payment-share.ts
index c4a82c917..ef4f8adeb 100644
--- a/packages/taler-harness/src/integrationtests/test-payment-share.ts
+++ b/packages/taler-harness/src/integrationtests/test-payment-share.ts
@@ -104,7 +104,7 @@ export async function runPaymentShareTest(t: GlobalTestState) {
claimFirstWallet.status === PreparePayResultType.PaymentPossible,
);
- //share order from the first wallet
+ // share order from the first wallet
const { privatePayUri } = await firstWallet.call(
WalletApiOperation.SharePayment,
{
@@ -113,7 +113,7 @@ export async function runPaymentShareTest(t: GlobalTestState) {
},
);
- //claim from the second wallet
+ // claim from the second wallet
const claimSecondWallet = await secondWallet.call(
WalletApiOperation.PreparePayForUri,
{ talerPayUri: privatePayUri },
@@ -123,11 +123,17 @@ export async function runPaymentShareTest(t: GlobalTestState) {
claimSecondWallet.status === PreparePayResultType.PaymentPossible,
);
- //pay from the second wallet
+ // pay from the second wallet
const r2 = await secondWallet.call(WalletApiOperation.ConfirmPay, {
proposalId: claimSecondWallet.proposalId,
});
+ // Wait for refresh to settle before we do checks
+ await secondWallet.call(
+ WalletApiOperation.TestingWaitTransactionsFinal,
+ {},
+ );
+
t.assertTrue(r2.type === ConfirmPayResultType.Done);
{
const first = await firstWallet.call(WalletApiOperation.GetBalances, {});
@@ -181,7 +187,7 @@ export async function runPaymentShareTest(t: GlobalTestState) {
claimFirstWallet.status === PreparePayResultType.PaymentPossible,
);
- //share order from the first wallet
+ // share order from the first wallet
const { privatePayUri } = await firstWallet.call(
WalletApiOperation.SharePayment,
{
@@ -190,7 +196,7 @@ export async function runPaymentShareTest(t: GlobalTestState) {
},
);
- //claim from the second wallet
+ // claim from the second wallet
const claimSecondWallet = await secondWallet.call(
WalletApiOperation.PreparePayForUri,
{ talerPayUri: privatePayUri },
@@ -200,13 +206,16 @@ export async function runPaymentShareTest(t: GlobalTestState) {
claimSecondWallet.status === PreparePayResultType.PaymentPossible,
);
- //pay from the second wallet
+ // pay from the second wallet
const r2 = await firstWallet.call(WalletApiOperation.ConfirmPay, {
proposalId: claimFirstWallet.proposalId,
});
t.assertTrue(r2.type === ConfirmPayResultType.Done);
+ // Wait for refreshes to settle before doing checks
+ await firstWallet.call(WalletApiOperation.TestingWaitTransactionsFinal, {});
+
const bal1 = await firstWallet.call(WalletApiOperation.GetBalances, {});
t.assertAmountEquals(bal1.balances[0].available, "TESTKUDOS:16.18");