diff --git a/server/src/app.integration.test.ts b/server/src/app.integration.test.ts index 734c104..9fb4c9d 100644 --- a/server/src/app.integration.test.ts +++ b/server/src/app.integration.test.ts @@ -87,8 +87,24 @@ describe("GET /api/note", () => { }); describe("POST /api/note", () => { - it("returns a view_url on correct POST body (without plugin version and user id)", async () => { - const res = await supertest(app).post("/api/note").send(testNote); + it("returns a view_url on correct POST body with embeds", async () => { + const res = await supertest(app) + .post("/api/note") + .send({ + ...testNote, + embeds: [ + { + embed_id: "sample_embed_id0", + ciphertext: Buffer.from("sample_ciphertext").toString("base64"), + hmac: Buffer.from("sample_hmac").toString("base64"), + }, + { + embed_id: "sample_embed_id1", + ciphertext: Buffer.from("sample_ciphertext").toString("base64"), + hmac: Buffer.from("sample_hmac").toString("base64"), + }, + ], + }); expectCodeOrThrowResponse(res, 200); diff --git a/server/src/controllers/note/note.post.controller.ts b/server/src/controllers/note/note.post.controller.ts index c554037..83f66fe 100644 --- a/server/src/controllers/note/note.post.controller.ts +++ b/server/src/controllers/note/note.post.controller.ts @@ -96,7 +96,6 @@ export async function postNoteController( // Validate user ID, if present if (notePostRequest.user_id && !checkId(notePostRequest.user_id)) { - console.log("invalid user id"); res.status(400).send("Invalid user id (checksum failed)"); event.error = "Invalid user id (checksum failed)"; EventLogger.writeEvent(event);