mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-28 01:21:13 +01:00
suggest topic test
This commit is contained in:
@@ -979,7 +979,7 @@ describe('Topic\'s', function () {
|
||||
|
||||
describe('suggested topics', function () {
|
||||
var tid1;
|
||||
var tid2;
|
||||
var tid3;
|
||||
before(function (done) {
|
||||
async.parallel({
|
||||
topic1: function (next) {
|
||||
@@ -988,10 +988,13 @@ describe('Topic\'s', function () {
|
||||
topic2: function (next) {
|
||||
topics.post({ uid: adminUid, tags: ['nodebb'], title: 'topic title 2', content: 'topic 2 content', cid: topic.categoryId }, next);
|
||||
},
|
||||
topic3: function (next) {
|
||||
topics.post({ uid: adminUid, tags: [], title: 'topic title 3', content: 'topic 3 content', cid: topic.categoryId }, next);
|
||||
},
|
||||
}, function (err, results) {
|
||||
assert.ifError(err);
|
||||
tid1 = results.topic1.topicData.tid;
|
||||
tid2 = results.topic2.topicData.tid;
|
||||
tid3 = results.topic3.topicData.tid;
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -1003,6 +1006,14 @@ describe('Topic\'s', function () {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should return suggested topics', function (done) {
|
||||
topics.getSuggestedTopics(tid3, adminUid, 0, 2, function (err, topics) {
|
||||
assert.ifError(err);
|
||||
assert(Array.isArray(topics));
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('unread', function () {
|
||||
|
||||
Reference in New Issue
Block a user