diff options
author | Sebastian <sebasjm@gmail.com> | 2024-03-04 14:37:04 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2024-03-04 14:37:04 -0300 |
commit | a6473f4c0202344937fac9d37dbb9a66e3b699bd (patch) | |
tree | 95c4934d0fa32ef1451f99c86bb1a3cdf39fe695 | |
parent | 4d0bd5958690000a508c946b6d64819d55231375 (diff) | |
download | wallet-core-dev/sebasjm/fix-8481.tar.gz wallet-core-dev/sebasjm/fix-8481.tar.bz2 wallet-core-dev/sebasjm/fix-8481.zip |
assert that the order is paid in the first wallet after the other wallet has paiddev/sebasjm/fix-8481
-rw-r--r-- | packages/taler-harness/src/integrationtests/test-payment-share.ts | 19 |
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"); |