Skip to content

Node.js based forum software built for the modern web

more tests

Barış Soner Uşaklıc364cebbe490
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) {