diff --git a/public/openapi/write/chats/roomId/messages/mid.yaml b/public/openapi/write/chats/roomId/messages/mid.yaml index dfa06e7811..c899627802 100644 --- a/public/openapi/write/chats/roomId/messages/mid.yaml +++ b/public/openapi/write/chats/roomId/messages/mid.yaml @@ -49,7 +49,7 @@ put: type: number required: true description: a valid message id - example: 3 + example: 2 requestBody: required: true content: @@ -92,7 +92,7 @@ delete: type: number required: true description: a valid message id - example: 3 + example: 2 responses: '200': description: Message successfully deleted @@ -125,7 +125,7 @@ post: type: number required: true description: a valid message id - example: 3 + example: 2 responses: '200': description: message successfully restored diff --git a/public/openapi/write/chats/roomId/messages/mid/ip.yaml b/public/openapi/write/chats/roomId/messages/mid/ip.yaml index 1730542213..2c2af8fb1b 100644 --- a/public/openapi/write/chats/roomId/messages/mid/ip.yaml +++ b/public/openapi/write/chats/roomId/messages/mid/ip.yaml @@ -17,7 +17,7 @@ get: type: string required: true description: a valid chat message id - example: 3 + example: 2 responses: '200': description: Chat message ip address retrieved diff --git a/test/api.js b/test/api.js index f7616904c8..fbb36b24b8 100644 --- a/test/api.js +++ b/test/api.js @@ -282,8 +282,13 @@ describe('API', async () => { await flags.appendNote(flagId, 1, 'test note', 1626446956652); await flags.create('post', 2, unprivUid, 'sample reasons', Date.now()); // for testing flag notes (since flag 1 deleted) - // Create a new chat room - await messaging.newRoom(adminUid, { uids: [unprivUid] }); + // Create a new chat room & send a message + const roomId = await messaging.newRoom(adminUid, { uids: [unprivUid] }); + await messaging.sendMessage({ + roomId, + uid: adminUid, + content: 'this is a chat message', + }); // Create an empty file to test DELETE /files and thumb deletion fs.closeSync(fs.openSync(path.resolve(nconf.get('upload_path'), 'files/test.txt'), 'w'));