diff options
author | ms <ms@taler.net> | 2021-09-01 17:51:52 +0200 |
---|---|---|
committer | ms <ms@taler.net> | 2021-09-01 17:51:52 +0200 |
commit | 8b73c30b1f5223ea1c64a9164b43b7ba3b5168a1 (patch) | |
tree | 4f5eeb1a371e1053ab23170ad11bb3a15542bd20 /packages/taler-wallet-cli/src/integrationtests/test-libeufin-refund-multiple-users.ts | |
parent | 79c14e77ecdb0fcf11c109cd53ce8d065d47c611 (diff) |
Avoid Sandbox (deprecated) POST /admin/payments/ API.
Diffstat (limited to 'packages/taler-wallet-cli/src/integrationtests/test-libeufin-refund-multiple-users.ts')
-rw-r--r-- | packages/taler-wallet-cli/src/integrationtests/test-libeufin-refund-multiple-users.ts | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-refund-multiple-users.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-refund-multiple-users.ts index d15a2d653..1159ddf48 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-refund-multiple-users.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-refund-multiple-users.ts @@ -68,39 +68,37 @@ export async function runLibeufinRefundMultipleUsersTest(t: GlobalTestState) { ["twg"], ); - /** - * user01 pays user02 using a invalid subject. At the end, - * user01 checks whether one incoming payment exists in the - * history. This one incoming payment will be the refund. - */ - await LibeufinSandboxApi.bookPayment( - libeufinServices.libeufinSandbox, - user02sandbox, - user01sandbox, + // user 01 gets the payment + await libeufinServices.libeufinSandbox.makeTransaction( + user02sandbox.ebicsBankAccount.label, // debit + user01sandbox.ebicsBankAccount.label, // credit + "EUR:1", "not a public key", - "1", - "EUR", ); + // user 01 fetches the payments await LibeufinNexusApi.fetchAllTransactions( libeufinServices.libeufinNexus, - user02nexus.localAccountName, + user01nexus.localAccountName, ); - delayMs(2000); // time to ingest. + // user 01 tries to submit the reimbursement, as + // the payment didn't have a valid public key in + // the subject. await LibeufinNexusApi.submitInitiatedPayment( libeufinServices.libeufinNexus, - user02nexus.localAccountName, + user01nexus.localAccountName, "1", // so far the only one that can exist. ); - // Counterpart checks whether the reimbursement shows up. + // user 02 checks whether a reimbursement arrived. let history = await LibeufinSandboxApi.getAccountTransactions( libeufinServices.libeufinSandbox, - user01sandbox.ebicsBankAccount["label"], + user02sandbox.ebicsBankAccount["label"], ); - - t.assertTrue(history["payments"].length == 1); + // reimbursement arrived IFF the total payments are 2: + // 1 the original (faulty) transaction + 1 the reimbursement. + t.assertTrue(history["payments"].length == 2); } runLibeufinRefundMultipleUsersTest.suites = ["libeufin"]; |