Add more services; Version 0.3.3

This commit is contained in:
Aslan 2025-12-29 02:02:56 +01:00
parent 50348cc494
commit ddcc591d12
26 changed files with 887 additions and 38 deletions

View file

@ -134,3 +134,43 @@ test("can delete session", async () => {
assert.equal(responseSessions2.id, state.userId);
assert.equal(responseSessions2.sessions.length, 1);
});
/*
test("can create user", async () => {
state.newUserName = "New User";
state.newUserPassword = "2142";
state.newUserDescription = "This is a New User";
const response = await apiPost(
`user`,
{
username: state.newUserName,
password: state.newUserPassword,
description: state.newUserDescription,
},
state.token,
);
assert.equal(validate(response.id), true);
assert.equal(response.username, state.newUserName);
assert.equal(response.description, state.newUserDescription);
assert.equal(response.admin, false);
state.newUserId = response.id;
const responseGet = await apiGet(`user/${state.newUserId}`, state.token);
assert.equal(responseGet.username, state.newUserName);
});
test("can delete user", async () => {
const responseDelete = await apiDelete(
`user/${state.newUserId}`,
{},
state.token,
);
assert.equal(responseDelete.id, state.newUserId);
const responseGet = await apiGet(`user/${state.newUserId}`, state.token);
assert.equal(responseGet.error, "NOT_FOUND");
});
*/