Skip to content

Commit

Permalink
fix: add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DevNono committed Sep 20, 2023
1 parent f667157 commit 5b88ed3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
2 changes: 2 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Bienvenue sur le Wiki de l'UTT Arena. Le but est d'expliquer les choix effectué

- [Github api bouffe](https://github.com/ungdev/UA-bouffe-api)

- [Github appli sécu](https://github.com/ungdev/UA-appli-secu)

- [References de l'API](https://arena.dev.uttnetgroup.fr/api/docs/)

- [References de la DB](https://dbdocs.io/arena/dev)
Expand Down
24 changes: 16 additions & 8 deletions tests/admin/upload/uploadFile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ describe('POST /admin/upload', () => {
let admin: User;
let adminToken: string;

let validObject = {

Check failure on line 15 in tests/admin/upload/uploadFile.test.ts

View workflow job for this annotation

GitHub Actions / lint (18)

'validObject' is never reassigned. Use 'const' instead
name: "test",

Check warning on line 16 in tests/admin/upload/uploadFile.test.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Replace `"test"` with `'test'`
path: "tournaments",

Check warning on line 17 in tests/admin/upload/uploadFile.test.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Replace `"tournaments"` with `'tournaments'`
file: new File(["foo"], "foo.jpg", {

Check warning on line 18 in tests/admin/upload/uploadFile.test.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Replace `"foo"],·"foo.jpg"` with `'foo'],·'foo.jpg'`
type: "image/jpeg",

Check warning on line 19 in tests/admin/upload/uploadFile.test.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Replace `"image/jpeg"` with `'image/jpeg'`
}),
};

after(async () => {
await database.user.deleteMany();
});
Expand All @@ -33,15 +41,15 @@ describe('POST /admin/upload', () => {
.expect(403, { error: Error.NoPermission });
});

Check warning on line 43 in tests/admin/upload/uploadFile.test.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Delete `·`
// it('should fail with an internal server error', async () => {
// sandbox.stub(uploadOperation, 'uploadFile').throws('Unexpected error');
it('should fail with an internal server error', async () => {
sandbox.stub(uploadOperation, 'uploadFile').throws('Unexpected error');

// await request(app)
// .post(`/admin/upload`)
// // .send({ path: 'tournaments/lol-logo.png' })
// .set('Authorization', `Bearer ${adminToken}`)
// .expect(500, { error: Error.InternalServerError });
// });
await request(app)
.post(`/admin/upload`)
.send(validObject)
.set('Authorization', `Bearer ${adminToken}`)
.expect(500, { error: Error.InternalServerError });
});

// it('should fail because no path is provided', async () => {
// await request(app)
Expand Down

0 comments on commit 5b88ed3

Please sign in to comment.