diff options
author | ms <ms@taler.net> | 2021-08-18 19:55:49 +0200 |
---|---|---|
committer | ms <ms@taler.net> | 2021-08-18 19:55:49 +0200 |
commit | e5d10137dd4a45f06d07d7605b73c4c276a82c02 (patch) | |
tree | 429a899f6af7691101e7ae6ec87480881741def6 /packages | |
parent | 739e6576a8f9efc593fc1041de8a7cf73b06f52d (diff) |
Checking the start and delta params of Anastasis API.
Diffstat (limited to 'packages')
-rw-r--r-- | packages/taler-wallet-cli/src/integrationtests/test-libeufin-facade-anastasis.ts | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-facade-anastasis.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-facade-anastasis.ts index e559d7e39..8d70c68bc 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-facade-anastasis.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-facade-anastasis.ts @@ -125,6 +125,43 @@ export async function runLibeufinAnastasisFacadeTest(t: GlobalTestState) { t.assertTrue(txsList.length == 2); t.assertTrue([txsList[0].subject, txsList[1].subject].includes("Anastasis donation")); t.assertTrue([txsList[0].subject, txsList[1].subject].includes("another Anastasis donation")); + + LibeufinSandboxApi.simulateIncomingTransaction( + libeufinServices.libeufinSandbox, + user01sandbox.ebicsBankAccount.label, + { + debtorIban: "ES3314655813489414469157", + debtorBic: "BCMAESM1XXX", + debtorName: "Mock Donor", + subject: "last Anastasis donation", + amount: "10.10", // Sandbox takes currency from its "config" + }, + ) + + await LibeufinNexusApi.fetchAllTransactions( + libeufinServices.libeufinNexus, + user01nexus.localAccountName, + ); + + let txsLast = await LibeufinNexusApi.getAnastasisTransactions( + libeufinServices.libeufinNexus, + anastasisBaseUrl, + {delta: 5, start: 2}, + user01nexus.userReq.username, + user01nexus.userReq.password, + ); + console.log(txsLast.data.incoming_transactions[0].subject == "last Anastasis donation"); + + let txsReverse = await LibeufinNexusApi.getAnastasisTransactions( + libeufinServices.libeufinNexus, + anastasisBaseUrl, + {delta: -5, start: 4}, + user01nexus.userReq.username, + user01nexus.userReq.password, + ); + t.assertTrue(txsReverse.data.incoming_transactions[0].row_id == 3); + t.assertTrue(txsReverse.data.incoming_transactions[1].row_id == 2); + t.assertTrue(txsReverse.data.incoming_transactions[2].row_id == 1); } runLibeufinAnastasisFacadeTest.suites = ["libeufin"]; |