mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-04 11:31:23 +01:00
Merge remote-tracking branch 'refs/remotes/origin/master' into develop
This commit is contained in:
@@ -437,6 +437,17 @@ describe('Messaging Library', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('should escape teaser', function (done) {
|
||||
socketModules.chats.send({ uid: fooUid }, { roomId: roomId, message: '<svg/onload=alert(document.location);' }, function (err, messageData) {
|
||||
assert.ifError(err);
|
||||
socketModules.chats.getRecentChats({ uid: fooUid }, { after: 0, uid: fooUid }, function (err, data) {
|
||||
assert.ifError(err);
|
||||
assert.equal(data.rooms[0].teaser.content, '<svg/onload=alert(document.location);');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should fail to check if user has private chat with invalid data', function (done) {
|
||||
socketModules.chats.hasPrivateChat({ uid: null }, null, function (err) {
|
||||
assert.equal(err.message, '[[error:invalid-data]]');
|
||||
|
||||
Reference in New Issue
Block a user