taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 8a111862400915627227fa432fab017833ec93a7
parent 3b8124b971cfed81a7976cd9c52b4d2b0e9a8482
Author: Sebastian <sebasjm@gmail.com>
Date:   Mon,  4 Mar 2024 14:37:04 -0300

assert that the order is paid in the first wallet after the other wallet has paid

Diffstat:
Mpackages/taler-harness/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 @@ -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");