diff options
author | MS <ms@taler.net> | 2022-12-17 00:26:02 +0100 |
---|---|---|
committer | MS <ms@taler.net> | 2022-12-17 00:26:02 +0100 |
commit | d5efb6198ea6a5fc159c8d546a1af13ff3d301e9 (patch) | |
tree | 28a0246541732a1dae47e39d5e36a1b0130f515e /packages/taler-wallet-cli/src | |
parent | 39b02d6878c91da0aa0809d57179779381656a3e (diff) | |
download | wallet-core-d5efb6198ea6a5fc159c8d546a1af13ff3d301e9.tar.xz |
libeufin tests: adapt to new report/statement policy
Diffstat (limited to 'packages/taler-wallet-cli/src')
-rw-r--r-- | packages/taler-wallet-cli/src/integrationtests/test-libeufin-c5x.ts | 42 | ||||
-rw-r--r-- | packages/taler-wallet-cli/src/integrationtests/test-libeufin-nexus-balance.ts | 7 |
2 files changed, 31 insertions, 18 deletions
diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-c5x.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-c5x.ts index cc46c6d33..2ba29656a 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-c5x.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-c5x.ts @@ -89,8 +89,6 @@ export async function runLibeufinC5xTest(t: GlobalTestState) { "first payment", ); - // Checking that C52 has one and C53 has zero. - let expectOne = await LibeufinNexusApi.fetchTransactions( libeufinServices.libeufinNexus, user01nexus.localAccountName, @@ -100,22 +98,43 @@ export async function runLibeufinC5xTest(t: GlobalTestState) { t.assertTrue(expectOne.data.newTransactions == 1); t.assertTrue(expectOne.data.downloadedTransactions == 1); + /* Expect zero payments being downloaded because the + * previous request consumed already the one pending + * payment. + */ let expectZero = await LibeufinNexusApi.fetchTransactions( libeufinServices.libeufinNexus, user01nexus.localAccountName, "all", // range + "report", // C52 + ); + t.assertTrue(expectZero.data.newTransactions == 0); + t.assertTrue(expectZero.data.downloadedTransactions == 0); + + /** + * A statement should still account zero payments because + * so far the payment made before is still pending. + */ + expectZero = await LibeufinNexusApi.fetchTransactions( + libeufinServices.libeufinNexus, + user01nexus.localAccountName, + "all", // range "statement", // C53 ); t.assertTrue(expectZero.data.newTransactions == 0); t.assertTrue(expectZero.data.downloadedTransactions == 0); - // Ticking now: the one payment should be downloaded - // in a C53 but not in a C52. In any case, the payment - // is not new anymore, because it was already ingested - // when it was downloaded for the first time along the - // c52 above. + /** + * Ticking now. That books any pending transaction. + */ await libeufinServices.libeufinSandbox.c53tick(); + /** + * A statement is now expected to download the transaction, + * although that got already ingested along the report + * earlier. Thus the transaction counts as downloaded but + * not as new. + */ expectOne = await LibeufinNexusApi.fetchTransactions( libeufinServices.libeufinNexus, user01nexus.localAccountName, @@ -124,14 +143,5 @@ export async function runLibeufinC5xTest(t: GlobalTestState) { ); t.assertTrue(expectOne.data.downloadedTransactions == 1); t.assertTrue(expectOne.data.newTransactions == 0); - - expectZero = await LibeufinNexusApi.fetchTransactions( - libeufinServices.libeufinNexus, - user01nexus.localAccountName, - "all", // range - "report", // C52 - ); - t.assertTrue(expectZero.data.downloadedTransactions == 0); - t.assertTrue(expectZero.data.newTransactions == 0); } runLibeufinC5xTest.suites = ["libeufin"]; diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-nexus-balance.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-nexus-balance.ts index b1ef53a79..850b0f1d9 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-nexus-balance.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-nexus-balance.ts @@ -89,10 +89,13 @@ export async function runLibeufinNexusBalanceTest(t: GlobalTestState) { ); t.assertAmountEquals(accountInfo.data.lastSeenBalance, "EUR:20"); + // Booking the first two transactions. + await libeufinServices.libeufinSandbox.c53tick(); + // user 01 gives 30 await libeufinServices.libeufinSandbox.makeTransaction( - user01sandbox.ebicsBankAccount.label, // credit - user02sandbox.ebicsBankAccount.label, // debit + user01sandbox.ebicsBankAccount.label, + user02sandbox.ebicsBankAccount.label, "EUR:30", "third payment", ); |