fix: deleted chat messages (#11962)

* fix: deleted chat messages

* fix spec
This commit is contained in:
Barış Soner Uşaklı
2023-08-28 12:10:42 -04:00
committed by GitHub
parent b25793cd41
commit 1a1fd64d9a
6 changed files with 25 additions and 13 deletions

View File

@@ -659,6 +659,13 @@ describe('Messaging Library', () => {
});
});
it('should not show deleted message to other users', async () => {
const { body } = await callv3API('get', `/chats/${roomId}/messages/${mid}`, {}, 'herp');
const message = body.response;
assert.strictEqual(message.deleted, 1);
assert.strictEqual(message.content, '<p>[[modules:chat.message-deleted]]</p>');
});
it('should error out if a message is deleted again', async () => {
const { statusCode, body } = await callv3API('delete', `/chats/${roomId}/messages/${mid}`, {}, 'foo');
assert.strictEqual(statusCode, 400);