aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-08-07 12:39:26 +0200
committerFlorian Dold <florian@dold.me>2021-08-07 12:39:26 +0200
commit34c405f4c916c320a0662678ad273c469f069ca1 (patch)
treed0e8af009015da6e7b760456e6177c6a06106be2
parent20ffa834d8e1b135b308e27d2b655e6868ce1872 (diff)
adjust libeufin test cases
-rw-r--r--packages/taler-wallet-cli/src/integrationtests/libeufin.ts3
-rw-r--r--packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-permissions.ts8
-rw-r--r--packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-users.ts12
3 files changed, 10 insertions, 13 deletions
diff --git a/packages/taler-wallet-cli/src/integrationtests/libeufin.ts b/packages/taler-wallet-cli/src/integrationtests/libeufin.ts
index 5e524af1e..383014b93 100644
--- a/packages/taler-wallet-cli/src/integrationtests/libeufin.ts
+++ b/packages/taler-wallet-cli/src/integrationtests/libeufin.ts
@@ -1133,11 +1133,12 @@ export namespace LibeufinNexusApi {
export async function changePassword(
libeufinNexusService: LibeufinNexusServiceInterface,
+ username: string,
req: UpdateNexusUserRequest,
auth: NexusAuth,
) {
const baseUrl = libeufinNexusService.baseUrl;
- let url = new URL(`/users/password`, baseUrl);
+ let url = new URL(`/users/${username}/password`, baseUrl);
await axios.post(url.href, req, auth);
}
diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-permissions.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-permissions.ts
index 0090819e3..abb843c94 100644
--- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-permissions.ts
+++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-permissions.ts
@@ -17,12 +17,9 @@
/**
* Imports.
*/
-import { GlobalTestState, setupDb } from "./harness";
+import { GlobalTestState } from "./harness";
import {
- SandboxUserBundle,
NexusUserBundle,
- launchLibeufinServices,
- LibeufinSandboxApi,
LibeufinNexusApi,
LibeufinNexusService,
} from "./libeufin";
@@ -51,7 +48,7 @@ export async function runLibeufinApiPermissionsTest(t: GlobalTestState) {
let transferPermission = await LibeufinNexusApi.getAllPermissions(nexus);
let element = transferPermission.data["permissions"].pop();
t.assertTrue(
- element["permissionName"] == "facade.talerWireGateway.transfer" &&
+ element["permissionName"] == "facade.talerwiregateway.transfer" &&
element["subjectId"] == "username-01",
);
let denyTransfer = user01nexus.twgTransferPermission;
@@ -63,4 +60,5 @@ export async function runLibeufinApiPermissionsTest(t: GlobalTestState) {
transferPermission = await LibeufinNexusApi.getAllPermissions(nexus);
t.assertTrue(transferPermission.data["permissions"].length == 0);
}
+
runLibeufinApiPermissionsTest.suites = ["libeufin"];
diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-users.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-users.ts
index d4d451ed7..b53db4212 100644
--- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-users.ts
+++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-users.ts
@@ -18,11 +18,7 @@
* Imports.
*/
import { GlobalTestState } from "./harness";
-import {
- NexusUserBundle,
- LibeufinNexusApi,
- LibeufinNexusService,
-} from "./libeufin";
+import { LibeufinNexusApi, LibeufinNexusService } from "./libeufin";
/**
* Run basic test with LibEuFin.
@@ -42,13 +38,14 @@ export async function runLibeufinApiUsersTest(t: GlobalTestState) {
await LibeufinNexusApi.changePassword(
nexus,
+ "one",
{
newPassword: "got-changed",
},
{
auth: {
- username: "one",
- password: "will-be-changed",
+ username: "admin",
+ password: "test",
},
},
);
@@ -62,4 +59,5 @@ export async function runLibeufinApiUsersTest(t: GlobalTestState) {
console.log(resp.data);
t.assertTrue(resp.data["username"] == "one" && !resp.data["superuser"]);
}
+
runLibeufinApiUsersTest.suites = ["libeufin"];