diff options
author | Florian Dold <florian@dold.me> | 2023-09-21 17:56:29 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-09-21 17:56:29 +0200 |
commit | 58debefbe0456ce203877f1cc417c42f4abb0685 (patch) | |
tree | da8e0ffdca8825eb2a59c81b699fd3e6b2913037 /packages/taler-wallet-core/src/operations/testing.ts | |
parent | 0388d31d364139d0a3999126b06d8ac850117ab9 (diff) | |
download | wallet-core-58debefbe0456ce203877f1cc417c42f4abb0685.tar.xz |
wallet-core,harness: towards corebank API instead of fakebank/nexus API
Diffstat (limited to 'packages/taler-wallet-core/src/operations/testing.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/testing.ts | 21 |
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; } |