[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] 02/03: assert that the order is paid in the first wa
From: |
gnunet |
Subject: |
[taler-wallet-core] 02/03: assert that the order is paid in the first wallet after the other wallet has paid |
Date: |
Tue, 05 Mar 2024 01:28:36 +0100 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository wallet-core.
commit 8a111862400915627227fa432fab017833ec93a7
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Mon Mar 4 14:37:04 2024 -0300
assert that the order is paid in the first wallet after the other wallet
has paid
---
.../src/integrationtests/test-payment-share.ts | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
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");
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.