diff --git a/docs/index.md b/docs/index.md index 0e84860a..ed7cb15b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -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) diff --git a/tests/admin/upload/uploadFile.test.ts b/tests/admin/upload/uploadFile.test.ts index 57b72975..94b08c18 100644 --- a/tests/admin/upload/uploadFile.test.ts +++ b/tests/admin/upload/uploadFile.test.ts @@ -12,6 +12,14 @@ describe('POST /admin/upload', () => { let admin: User; let adminToken: string; + let validObject = { + name: "test", + path: "tournaments", + file: new File(["foo"], "foo.jpg", { + type: "image/jpeg", + }), + }; + after(async () => { await database.user.deleteMany(); }); @@ -33,15 +41,15 @@ describe('POST /admin/upload', () => { .expect(403, { error: Error.NoPermission }); }); - // 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)