diff options
Diffstat (limited to 'packages/taler-harness/src/integrationtests/test-payment-share.ts')
-rw-r--r-- | packages/taler-harness/src/integrationtests/test-payment-share.ts | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-payment-share.ts b/packages/taler-harness/src/integrationtests/test-payment-share.ts index ef4f8adeb..034bbc98d 100644 --- a/packages/taler-harness/src/integrationtests/test-payment-share.ts +++ b/packages/taler-harness/src/integrationtests/test-payment-share.ts @@ -65,6 +65,8 @@ export async function runPaymentShareTest(t: GlobalTestState) { }); await secondWallet.call(WalletApiOperation.TestingWaitTransactionsFinal, {}); + t.logStep("setup-done"); + // create two orders to pay async function createOrder(amount: string) { const order = { @@ -74,7 +76,6 @@ export async function runPaymentShareTest(t: GlobalTestState) { }; const args = { order }; - const auth = {}; const orderResp = await merchantClient.createOrder({ order: args.order, @@ -88,6 +89,8 @@ export async function runPaymentShareTest(t: GlobalTestState) { return { id: orderResp.order_id, uri: orderStatus.taler_pay_uri }; } + t.logStep("orders-created"); + /** * FIRST CASE, create in first wallet and pay in the second wallet * first wallet should not be able to continue @@ -104,6 +107,8 @@ export async function runPaymentShareTest(t: GlobalTestState) { claimFirstWallet.status === PreparePayResultType.PaymentPossible, ); + t.logStep("w1-payment-possible"); + // share order from the first wallet const { privatePayUri } = await firstWallet.call( WalletApiOperation.SharePayment, @@ -113,6 +118,8 @@ export async function runPaymentShareTest(t: GlobalTestState) { }, ); + t.logStep("w1-payment-shared"); + // claim from the second wallet const claimSecondWallet = await secondWallet.call( WalletApiOperation.PreparePayForUri, @@ -123,18 +130,25 @@ export async function runPaymentShareTest(t: GlobalTestState) { claimSecondWallet.status === PreparePayResultType.PaymentPossible, ); + t.logStep("w2-claimed"); + // pay from the second wallet const r2 = await secondWallet.call(WalletApiOperation.ConfirmPay, { - proposalId: claimSecondWallet.proposalId, + transactionId: claimSecondWallet.transactionId, }); + t.assertTrue(r2.type === ConfirmPayResultType.Done); + + t.logStep("w2-confirmed"); + // Wait for refresh to settle before we do checks await secondWallet.call( WalletApiOperation.TestingWaitTransactionsFinal, {}, ); - t.assertTrue(r2.type === ConfirmPayResultType.Done); + t.logStep("w2-refresh-settled"); + { const first = await firstWallet.call(WalletApiOperation.GetBalances, {}); const second = await secondWallet.call( @@ -155,11 +169,16 @@ export async function runPaymentShareTest(t: GlobalTestState) { claimFirstWalletAgain.status === PreparePayResultType.AlreadyConfirmed, ); + t.logStep("w1-prepared-again"); + const r1 = await firstWallet.call(WalletApiOperation.ConfirmPay, { - proposalId: claimFirstWallet.proposalId, + transactionId: claimFirstWallet.transactionId, }); t.assertTrue(r1.type === ConfirmPayResultType.Done); + + t.logStep("w1-confirmed-shared"); + { const first = await firstWallet.call(WalletApiOperation.GetBalances, {}); const second = await secondWallet.call( @@ -171,6 +190,8 @@ export async function runPaymentShareTest(t: GlobalTestState) { } } + t.logStep("first-case-done"); + /** * SECOND CASE, create in first wallet and share to the second wallet * pay with the first wallet, second wallet should not be able to continue @@ -208,7 +229,7 @@ export async function runPaymentShareTest(t: GlobalTestState) { // pay from the second wallet const r2 = await firstWallet.call(WalletApiOperation.ConfirmPay, { - proposalId: claimFirstWallet.proposalId, + transactionId: claimFirstWallet.transactionId, }); t.assertTrue(r2.type === ConfirmPayResultType.Done); @@ -232,6 +253,8 @@ export async function runPaymentShareTest(t: GlobalTestState) { claimSecondWalletAgain.status === PreparePayResultType.AlreadyConfirmed, ); } + + t.logStep("second-case-done"); } runPaymentShareTest.suites = ["wallet"]; |