diff options
author | xnacly <matteogropp@protonmail.com> | 2021-08-18 19:29:16 +0200 |
---|---|---|
committer | xnacly <matteogropp@protonmail.com> | 2021-08-18 19:29:16 +0200 |
commit | 30a2937d65f134c1a100096ec8781676d57a5c01 (patch) | |
tree | 2a82f78b8c8f50c7d479d13afb0d712ba1251e21 /cdn | |
parent | added unittests for ping and attachments (diff) | |
download | server-30a2937d65f134c1a100096ec8781676d57a5c01.tar.xz |
added all unittests for attachments
Diffstat (limited to 'cdn')
-rw-r--r-- | cdn/tests/server.test.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/cdn/tests/server.test.js b/cdn/tests/server.test.js index 6d2521a8..77d2b949 100644 --- a/cdn/tests/server.test.js +++ b/cdn/tests/server.test.js @@ -80,12 +80,22 @@ describe("/attachments", () => { .set({ signature: Config.get().security.requestSignature }) .attach("file", __dirname + "/antman.jpg"); request.get(response.body.url.replace("http://localhost:3003", "")).then((x) => { - expect(x.statusCode).toBe(400); + expect(x.statusCode).toBe(200); }); }); }); }); describe("DELETE", () => { - describe("without signature specified", () => {}); + describe("deleting uploaded image by url returned by POST /attachments", () => { + test("route should respond with res.body.success", async () => { + let response = await request + .post("/attachments/123456789") + .set({ signature: Config.get().security.requestSignature }) + .attach("file", __dirname + "/antman.jpg"); + request.delete(response.body.url.replace("http://localhost:3003", "")).then((x) => { + expect(x.body.success).toBeDefined(); + }); + }); + }); }); }); |