aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-harness/src/integrationtests/test-payment-share.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-harness/src/integrationtests/test-payment-share.ts')
-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");