mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-21 07:50:37 +01:00
fix: tests
This commit is contained in:
@@ -1300,7 +1300,7 @@ describe('Controllers', function () {
|
|||||||
assert.equal(notif.bodyShort, notifData.bodyShort);
|
assert.equal(notif.bodyShort, notifData.bodyShort);
|
||||||
assert.equal(notif.bodyLong, notifData.bodyLong);
|
assert.equal(notif.bodyLong, notifData.bodyLong);
|
||||||
assert.equal(notif.pid, notifData.pid);
|
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);
|
assert.equal(notif.nid, notifData.nid);
|
||||||
next();
|
next();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -382,7 +382,7 @@ describe('Messaging Library', function () {
|
|||||||
var notification = data.unread[0];
|
var notification = data.unread[0];
|
||||||
assert.equal(notification.bodyShort, '[[notifications:new_message_from, foo]]');
|
assert.equal(notification.bodyShort, '[[notifications:new_message_from, foo]]');
|
||||||
assert.equal(notification.nid, 'chat_' + fooUid + '_' + roomId);
|
assert.equal(notification.nid, 'chat_' + fooUid + '_' + roomId);
|
||||||
assert.equal(notification.path, '/chats/' + roomId);
|
assert.equal(notification.path, nconf.get('relative_path') + '/chats/' + roomId);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
}, 1500);
|
}, 1500);
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
var assert = require('assert');
|
var assert = require('assert');
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
|
var nconf = require('nconf');
|
||||||
|
|
||||||
var db = require('./mocks/databasemock');
|
var db = require('./mocks/databasemock');
|
||||||
var meta = require('../src/meta');
|
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) {
|
it('should link to the first unread post in a watched topic', function (done) {
|
||||||
var categories = require('../src/categories');
|
var categories = require('../src/categories');
|
||||||
var topics = require('../src/topics');
|
var topics = require('../src/topics');
|
||||||
|
|
||||||
var watcherUid;
|
var watcherUid;
|
||||||
var cid;
|
var cid;
|
||||||
var tid;
|
var tid;
|
||||||
@@ -286,7 +286,7 @@ describe('Notifications', function () {
|
|||||||
},
|
},
|
||||||
function (notifications, next) {
|
function (notifications, next) {
|
||||||
assert.equal(notifications.unread.length, 1, 'there should be 1 unread notification');
|
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();
|
next();
|
||||||
},
|
},
|
||||||
], function (err) {
|
], function (err) {
|
||||||
@@ -300,7 +300,7 @@ describe('Notifications', function () {
|
|||||||
assert.ifError(err);
|
assert.ifError(err);
|
||||||
assert.equal(data[0].bodyShort, 'bodyShort');
|
assert.equal(data[0].bodyShort, 'bodyShort');
|
||||||
assert.equal(data[0].nid, 'notification_id');
|
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();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user