summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/taler-harness/src/integrationtests/test-payment-share.ts19
1 files changed, 18 insertions, 1 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-payment-share.ts b/packages/taler-harness/src/integrationtests/test-payment-share.ts
index d832a7e50..ec7391586 100644
--- a/packages/taler-harness/src/integrationtests/test-payment-share.ts
+++ b/packages/taler-harness/src/integrationtests/test-payment-share.ts
@@ -20,6 +20,7 @@
import {
ConfirmPayResultType,
MerchantApiClient,
+ NotificationType,
PreparePayResultType,
} from "@gnu-taler/taler-util";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
@@ -166,6 +167,11 @@ export async function runPaymentShareTest(t: GlobalTestState) {
t.assertAmountEquals(second.balances[0].available, "TESTKUDOS:14.23");
}
+ t.logStep("wait-for-payment");
+ firstWallet.waitForNotificationCond(n =>
+ n.type === NotificationType.TransactionStateTransition &&
+ n.transactionId === claimFirstWallet.transactionId
+ )
// Claim the order with the first wallet
const claimFirstWalletAgain = await firstWallet.call(
WalletApiOperation.PreparePayForUri,
@@ -175,6 +181,7 @@ export async function runPaymentShareTest(t: GlobalTestState) {
t.assertTrue(
claimFirstWalletAgain.status === PreparePayResultType.AlreadyConfirmed,
);
+ t.assertTrue( claimFirstWalletAgain.paid );
t.logStep("w1-prepared-again");
@@ -182,7 +189,7 @@ export async function runPaymentShareTest(t: GlobalTestState) {
transactionId: claimFirstWallet.transactionId,
});
- t.assertTrue(r1.type === ConfirmPayResultType.Done);
+ t.assertTrue(r1.type === ConfirmPayResultType.Pending);
t.logStep("w1-confirmed-shared");
@@ -255,6 +262,12 @@ export async function runPaymentShareTest(t: GlobalTestState) {
t.assertAmountEquals(bal1.balances[0].available, "TESTKUDOS:16.18");
t.assertAmountEquals(bal2.balances[0].available, "TESTKUDOS:14.23");
+ t.logStep("wait-for-payment");
+ secondWallet.waitForNotificationCond(n =>
+ n.type === NotificationType.TransactionStateTransition &&
+ n.transactionId === claimSecondWallet.transactionId
+ )
+
// Claim the order with the first wallet
const claimSecondWalletAgain = await secondWallet.call(
WalletApiOperation.PreparePayForUri,
@@ -264,6 +277,10 @@ export async function runPaymentShareTest(t: GlobalTestState) {
t.assertTrue(
claimSecondWalletAgain.status === PreparePayResultType.AlreadyConfirmed,
);
+ t.assertTrue(
+ claimSecondWalletAgain.paid,
+ );
+
}
t.logStep("second-case-done");