Skip to content

Commit a3ca2bf

Browse files
committed
project. e2e tests updated
1 parent 2656064 commit a3ca2bf

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

test/builds.e2e-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('Builds (e2e)', () => {
3232

3333
beforeEach(async () => {
3434
user = await haveUserLogged(usersService);
35-
project = await projecstService.create({ name: 'E2E test' });
35+
project = await projecstService.create({ name: 'E2E test', mainBranchName: 'master' });
3636
});
3737

3838
afterEach(async () => {

test/projects.e2e-spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const projectServiceMock = {
1616
findAll: () => ['test'],
1717
create: () => project,
1818
remove: () => project,
19+
update: () => project,
1920
};
2021

2122
describe('Projects (e2e)', () => {
@@ -91,4 +92,16 @@ describe('Projects (e2e)', () => {
9192
await requestWithAuth(app, 'delete', `/projects/${project.id}`, {}, 'asd').expect(401);
9293
});
9394
});
95+
96+
describe('PUT /', () => {
97+
it('can edit', async () => {
98+
const res = await requestWithAuth(app, 'put', `/projects`, project, loggedUser.token).expect(200);
99+
100+
expect(res.body).toStrictEqual(projectServiceMock.update());
101+
});
102+
103+
it('not valid token', async () => {
104+
await requestWithAuth(app, 'put', `/projects`, project, 'asd').expect(401);
105+
});
106+
});
94107
});

0 commit comments

Comments
 (0)