gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: fix bank API test


From: gnunet
Subject: [taler-wallet-core] branch master updated: fix bank API test
Date: Sun, 06 Sep 2020 14:54:39 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new 92873710 fix bank API test
92873710 is described below

commit 92873710f1e94a4b04a6785326f4dd27fb759237
Author: Florian Dold <florian.dold@gmail.com>
AuthorDate: Sun Sep 6 18:24:33 2020 +0530

    fix bank API test
---
 packages/taler-integrationtests/src/harness.ts       |  8 +++++---
 packages/taler-integrationtests/src/test-bank-api.ts | 14 +++++++-------
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/packages/taler-integrationtests/src/harness.ts 
b/packages/taler-integrationtests/src/harness.ts
index d974bdd0..90a618e1 100644
--- a/packages/taler-integrationtests/src/harness.ts
+++ b/packages/taler-integrationtests/src/harness.ts
@@ -564,8 +564,10 @@ export enum CreditDebitIndicator {
 }
 
 export interface BankAccountBalanceResponse {
-  amount: AmountString;
-  credit_debit_indicator: CreditDebitIndicator;
+  balance: {
+    amount: AmountString;
+    credit_debit_indicator: CreditDebitIndicator;
+  };
 }
 
 export namespace BankAccessApi {
@@ -573,7 +575,7 @@ export namespace BankAccessApi {
     bank: BankServiceInterface,
     bankUser: BankUser,
   ): Promise<BankAccountBalanceResponse> {
-    const url = new URL(`accounts/${bankUser.username}/balance`, bank.baseUrl);
+    const url = new URL(`accounts/${bankUser.username}`, bank.baseUrl);
     const resp = await axios.get(url.href, {
       auth: bankUser,
     });
diff --git a/packages/taler-integrationtests/src/test-bank-api.ts 
b/packages/taler-integrationtests/src/test-bank-api.ts
index 56f43985..51cf2e83 100644
--- a/packages/taler-integrationtests/src/test-bank-api.ts
+++ b/packages/taler-integrationtests/src/test-bank-api.ts
@@ -113,13 +113,13 @@ runTest(async (t: GlobalTestState) => {
     t.assertTrue(e.response?.status === 409);
   }
 
-  let bal = await BankAccessApi.getAccountBalance(bank, bankUser);
+  let balResp = await BankAccessApi.getAccountBalance(bank, bankUser);
 
-  console.log(bal);
+  console.log(balResp);
 
   // Check that we got the sign-up bonus.
-  t.assertAmountEquals(bal.amount, "TESTKUDOS:100");
-  t.assertTrue(bal.credit_debit_indicator === CreditDebitIndicator.Credit);
+  t.assertAmountEquals(balResp.balance.amount, "TESTKUDOS:100");
+  t.assertTrue(balResp.balance.credit_debit_indicator === 
CreditDebitIndicator.Credit);
 
   const res = createEddsaKeyPair();
 
@@ -130,7 +130,7 @@ runTest(async (t: GlobalTestState) => {
     reservePub: encodeCrock(res.eddsaPub),
   });
 
-  bal = await BankAccessApi.getAccountBalance(bank, bankUser);
-  t.assertAmountEquals(bal.amount, "TESTKUDOS:15");
-  t.assertTrue(bal.credit_debit_indicator === CreditDebitIndicator.Debit);
+  balResp = await BankAccessApi.getAccountBalance(bank, bankUser);
+  t.assertAmountEquals(balResp.balance.amount, "TESTKUDOS:15");
+  t.assertTrue(balResp.balance.credit_debit_indicator === 
CreditDebitIndicator.Debit);
 });

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]