From c364cebbe490489637432906d9989bb2d06349ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sat, 20 May 2017 20:20:53 -0400 Subject: [PATCH] more tests --- test/messaging.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/messaging.js b/test/messaging.js index a009d5ad21..5a9b0ac4a3 100644 --- a/test/messaging.js +++ b/test/messaging.js @@ -339,7 +339,7 @@ describe('Messaging Library', function () { }); it('should not error if user is not in room', function (done) { - socketModules.chats.markRead({ uid: herpUid }, roomId, function (err) { + socketModules.chats.markRead({ uid: herpUid }, 10, function (err) { assert.ifError(err); done(); }); @@ -511,6 +511,13 @@ describe('Messaging Library', function () { }); }); + it('should fail to delete message if not owner', function (done) { + socketModules.chats.delete({ uid: herpUid }, { messageId: mid, roomId: roomId }, function (err) { + assert.equal(err.message, '[[error:cant-delete-chat-message]]'); + done(); + }); + }); + it('should delete message', function (done) { socketModules.chats.delete({ uid: fooUid }, { messageId: mid, roomId: roomId }, function (err) {