Some checks are pending
Automatisch Backend Tests / test (push) Waiting to run
Automatisch CI / linter (push) Waiting to run
Automatisch CI / start-backend-server (push) Waiting to run
Automatisch CI / start-backend-worker (push) Waiting to run
Automatisch CI / build-web (push) Waiting to run
Automatisch UI Tests / test (push) Waiting to run
25 lines
681 B
JavaScript
25 lines
681 B
JavaScript
const { expect } = require('../fixtures/index');
|
|
|
|
export const addUser = async (apiRequest, token, request) => {
|
|
const addUserResponse = await apiRequest.post(
|
|
`${process.env.BACKEND_APP_URL}/api/v1/admin/users`,
|
|
{
|
|
headers: { Authorization: token },
|
|
data: request,
|
|
}
|
|
);
|
|
await expect(addUserResponse.status()).toBe(201);
|
|
|
|
return await addUserResponse.json();
|
|
};
|
|
|
|
export const acceptInvitation = async (apiRequest, request) => {
|
|
const acceptInvitationResponse = await apiRequest.post(
|
|
`${process.env.BACKEND_APP_URL}/api/v1/users/invitation`,
|
|
{
|
|
data: request,
|
|
}
|
|
);
|
|
await expect(acceptInvitationResponse.status()).toBe(204);
|
|
};
|