diff options
author | ms <ms@taler.net> | 2021-07-30 10:53:26 +0200 |
---|---|---|
committer | ms <ms@taler.net> | 2021-07-30 10:53:26 +0200 |
commit | 263b1e77511cb6afa91a40a5576ca0753be9ebc2 (patch) | |
tree | b80ffaddc8ed2d8b5f185b58b4989b24d0b7f20b | |
parent | 2ccfa3c2f2e52e6d8f0d629b48aa522b0df9965c (diff) |
Fix libeufin refund test.
The ingestion needed a delay to take place.
-rw-r--r-- | packages/taler-wallet-cli/src/integrationtests/test-libeufin-refund.ts | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-refund.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-refund.ts index 4cd943f5d..55a1f0c60 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-refund.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-refund.ts @@ -17,7 +17,7 @@ /** * Imports. */ -import { GlobalTestState } from "./harness"; +import { GlobalTestState, delayMs } from "./harness"; import { SandboxUserBundle, NexusUserBundle, @@ -71,15 +71,37 @@ export async function runLibeufinRefundTest(t: GlobalTestState) { "EUR", ); + // check payment shows up in the Sandbox' history. + // NOTE: the debitor account has no entry so far, because + // the call above is a mere test method that books only one + // CRDT transaction. + const txsCredit = await LibeufinSandboxApi.getAccountTransactions( + libeufinServices.libeufinSandbox, + user02sandbox.ebicsBankAccount["label"]); + t.assertTrue(txsCredit["payments"].length == 1); + + // Gets the faulty payment in the (ingested) history. await LibeufinNexusApi.fetchAllTransactions( libeufinServices.libeufinNexus, user02nexus.localAccountName, ); + // Give time to ingest. + delayMs(2000); + + // Check payment shows up in Nexus history. + const nexusTxs = await LibeufinNexusApi.getAccountTransactions( + libeufinServices.libeufinNexus, + user02nexus.localAccountName, + ); + t.assertTrue(nexusTxs.data["transactions"].length == 1); + // This should pay the faulty payment back. await LibeufinNexusApi.submitInitiatedPayment( libeufinServices.libeufinNexus, user02nexus.localAccountName, - "1", // so far the only one that can exist. + // The initiated payment ID below got set by the Taler + // facade; at this point only one can / must exist. + "1", ); // Counterpart checks whether the reimbursement shows up. @@ -87,7 +109,6 @@ export async function runLibeufinRefundTest(t: GlobalTestState) { libeufinServices.libeufinSandbox, user01sandbox.ebicsBankAccount["label"], ); - t.assertTrue(history["payments"].length == 1); } runLibeufinRefundTest.suites = ["libeufin"]; |