aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-09-06 18:24:33 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-09-06 18:24:33 +0530
commit92873710f1e94a4b04a6785326f4dd27fb759237 (patch)
treeaaf67a9cfc1bde0e37befba2ee3e1d8348cdcaa7
parent7863bcbcafeaea96f1a46ec9df79d94f8387111e (diff)
fix bank API test
-rw-r--r--packages/taler-integrationtests/src/harness.ts8
-rw-r--r--packages/taler-integrationtests/src/test-bank-api.ts14
2 files changed, 12 insertions, 10 deletions
diff --git a/packages/taler-integrationtests/src/harness.ts b/packages/taler-integrationtests/src/harness.ts
index d974bdd01..90a618e17 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 56f43985e..51cf2e83a 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);
});