more tests

This commit is contained in:
Barış Soner Uşaklı
2017-05-20 20:20:53 -04:00
parent 7fb45cc148
commit c364cebbe4

View File

@@ -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) {