aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/testing.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-core/src/operations/testing.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/testing.ts21
1 files changed, 15 insertions, 6 deletions
diff --git a/packages/taler-wallet-core/src/operations/testing.ts b/packages/taler-wallet-core/src/operations/testing.ts
index f71d842c7..b5840c3a6 100644
--- a/packages/taler-wallet-core/src/operations/testing.ts
+++ b/packages/taler-wallet-core/src/operations/testing.ts
@@ -25,6 +25,7 @@ import {
IntegrationTestV2Args,
Logger,
NotificationType,
+ RegisterAccountRequest,
stringToBytes,
TestPayResult,
TransactionMajorState,
@@ -216,17 +217,25 @@ async function confirmBankWithdrawalUri(
async function registerRandomBankUser(
http: HttpRequestLibrary,
- bankAccessApiBaseUrl: string,
+ corebankApiBaseUrl: string,
): Promise<BankUser> {
- const reqUrl = new URL("testing/register", bankAccessApiBaseUrl).href;
+ const reqUrl = new URL("accounts", corebankApiBaseUrl).href;
const randId = makeId(8);
+ const username = `testuser-${randId.toLowerCase()}`;
+ const password = `testpw-${randId}`;
+
const bankUser: BankUser = {
- // euFin doesn't allow resource names to have upper case letters.
- username: `testuser-${randId.toLowerCase()}`,
- password: `testpw-${randId}`,
+ username,
+ password,
+ };
+
+ const userReq: RegisterAccountRequest = {
+ username,
+ password,
+ name: username,
};
- const resp = await http.postJson(reqUrl, bankUser);
+ const resp = await http.fetch(reqUrl, { method: "POST", body: userReq });
await checkSuccessResponseOrThrow(resp);
return bankUser;
}