fix: tests

v1.18.x
Barış Soner Uşaklı 5 years ago
parent f28bd75f5e
commit e3c9dafa08

@ -1300,7 +1300,7 @@ describe('Controllers', function () {
assert.equal(notif.bodyShort, notifData.bodyShort);
assert.equal(notif.bodyLong, notifData.bodyLong);
assert.equal(notif.pid, notifData.pid);
assert.equal(notif.path, notifData.path);
assert.equal(notif.path, nconf.get('relative_path') + notifData.path);
assert.equal(notif.nid, notifData.nid);
next();
},

@ -382,7 +382,7 @@ describe('Messaging Library', function () {
var notification = data.unread[0];
assert.equal(notification.bodyShort, '[[notifications:new_message_from, foo]]');
assert.equal(notification.nid, 'chat_' + fooUid + '_' + roomId);
assert.equal(notification.path, '/chats/' + roomId);
assert.equal(notification.path, nconf.get('relative_path') + '/chats/' + roomId);
done();
});
}, 1500);

@ -3,6 +3,7 @@
var assert = require('assert');
var async = require('async');
var nconf = require('nconf');
var db = require('./mocks/databasemock');
var meta = require('../src/meta');
@ -228,7 +229,6 @@ describe('Notifications', function () {
it('should link to the first unread post in a watched topic', function (done) {
var categories = require('../src/categories');
var topics = require('../src/topics');
var watcherUid;
var cid;
var tid;
@ -286,7 +286,7 @@ describe('Notifications', function () {
},
function (notifications, next) {
assert.equal(notifications.unread.length, 1, 'there should be 1 unread notification');
assert.equal('/post/' + pid, notifications.unread[0].path, 'the notification should link to the first unread post');
assert.equal(nconf.get('relative_path') + '/post/' + pid, notifications.unread[0].path, 'the notification should link to the first unread post');
next();
},
], function (err) {
@ -300,7 +300,7 @@ describe('Notifications', function () {
assert.ifError(err);
assert.equal(data[0].bodyShort, 'bodyShort');
assert.equal(data[0].nid, 'notification_id');
assert.equal(data[0].path, '/notification/path');
assert.equal(data[0].path, nconf.get('relative_path') + '/notification/path');
done();
});
});

Loading…
Cancel
Save