Skip to content

Commit

Permalink
(chore)reflow source code
Browse files Browse the repository at this point in the history
  • Loading branch information
hotzevzl committed Nov 16, 2023
1 parent 2008ef9 commit 557b277
Showing 1 changed file with 30 additions and 12 deletions.
42 changes: 30 additions & 12 deletions api/apps/api/test/projects/crud/projects.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,18 @@ describe('ProjectsModule (e2e)', () => {
it('should succeed when giving minimum required data', async () => {
const userToken = await api.utils.createWorkingUser();

const { body: organizationResponse } = await api.requests.organizations
const {
body: organizationResponse,
} = await api.requests.organizations
.createOrganization(userToken)
.expect(HttpStatus.CREATED);
const projectData = {
...E2E_CONFIG.projects.valid.minimal(),
organizationId: organizationResponse.data.id,
};
const { body: projectResponse } = await api.requests.projects
const {
body: projectResponse,
} = await api.requests.projects
.createProject(userToken, projectData)
.expect(HttpStatus.CREATED);

Expand Down Expand Up @@ -153,7 +157,9 @@ describe('ProjectsModule (e2e)', () => {
const { body: userProjects } = await api.requests.projects
.listProjects(userToken)
.expect(HttpStatus.OK);
const { body: anotherUserProjects } = await api.requests.projects
const {
body: anotherUserProjects,
} = await api.requests.projects
.listProjects(anotherUserToken)
.expect(HttpStatus.OK);

Expand All @@ -179,7 +185,9 @@ describe('ProjectsModule (e2e)', () => {
description: 'cannotBeFound',
});

const { body: projectsResponse } = await api.requests.projects
const {
body: projectsResponse,
} = await api.requests.projects
.listProjects(userToken)
.expect(HttpStatus.OK);

Expand Down Expand Up @@ -207,7 +215,9 @@ describe('ProjectsModule (e2e)', () => {
const userToken = await api.utils.createWorkingUser();
await api.utils.createWorkingProjectWithScenario(userToken);

const { body: projectsResponse } = await api.requests.projects
const {
body: projectsResponse,
} = await api.requests.projects
.listProjects(userToken, { include: ['scenarios'] })
.expect(HttpStatus.OK);

Expand All @@ -224,7 +234,9 @@ describe('ProjectsModule (e2e)', () => {
await api.requests.projects
.deleteProject(userToken, data.id)
.expect(HttpStatus.OK);
const { body: projectsResponse } = await api.requests.projects
const {
body: projectsResponse,
} = await api.requests.projects
.listProjects(userToken)
.expect(HttpStatus.OK);

Expand All @@ -233,13 +245,16 @@ describe('ProjectsModule (e2e)', () => {

it('should succeed with a project with scenarios', async () => {
const userToken = await api.utils.createWorkingUser();
const { data } =
await api.utils.createWorkingProjectWithScenario(userToken);
const { data } = await api.utils.createWorkingProjectWithScenario(
userToken,
);

await api.requests.projects
.deleteProject(userToken, data.id)
.expect(HttpStatus.OK);
const { body: projectsResponse } = await api.requests.projects
const {
body: projectsResponse,
} = await api.requests.projects
.listProjects(userToken)
.expect(HttpStatus.OK);

Expand All @@ -251,13 +266,16 @@ describe('ProjectsModule (e2e)', () => {
const anotherUser = await api.utils.createWorkingUser({
email: '[email protected]',
});
const { data } =
await api.utils.createWorkingProjectWithScenario(userToken);
const { data } = await api.utils.createWorkingProjectWithScenario(
userToken,
);

await api.requests.projects
.deleteProject(anotherUser, data.id)
.expect(HttpStatus.FORBIDDEN);
const { body: projectsResponse } = await api.requests.projects
const {
body: projectsResponse,
} = await api.requests.projects
.listProjects(userToken)
.expect(HttpStatus.OK);

Expand Down

0 comments on commit 557b277

Please sign in to comment.