mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55:55 +01:00
Recent refactor (#6879)
* wip * fix inf scroll * remove duplicated code * remove dupe code in /unread * use topicList * update tag page to use topicList * fix tests * combine ifs * remove more dupe code * disable timeout
This commit is contained in:
committed by
GitHub
parent
aa301f27a1
commit
c27be9db5a
@@ -1064,7 +1064,7 @@ describe('Topic\'s', function () {
|
||||
});
|
||||
|
||||
it('should error with invalid data', function (done) {
|
||||
socketTopics.loadMoreUnreadTopics({ uid: adminUid }, { after: 'invalid' }, function (err) {
|
||||
socketTopics.loadMoreSortedTopics({ uid: adminUid }, { after: 'invalid' }, function (err) {
|
||||
assert.equal(err.message, '[[error:invalid-data]]');
|
||||
done();
|
||||
});
|
||||
@@ -1073,7 +1073,7 @@ describe('Topic\'s', function () {
|
||||
it('should load more unread topics', function (done) {
|
||||
socketTopics.markUnread({ uid: adminUid }, tid, function (err) {
|
||||
assert.ifError(err);
|
||||
socketTopics.loadMoreUnreadTopics({ uid: adminUid }, { cid: topic.categoryId, after: 0, count: 10 }, function (err, data) {
|
||||
socketTopics.loadMoreSortedTopics({ uid: adminUid }, { cid: topic.categoryId, after: 0, count: 10, sort: 'unread' }, function (err, data) {
|
||||
assert.ifError(err);
|
||||
assert(data);
|
||||
assert(Array.isArray(data.topics));
|
||||
@@ -1083,7 +1083,7 @@ describe('Topic\'s', function () {
|
||||
});
|
||||
|
||||
it('should error with invalid data', function (done) {
|
||||
socketTopics.loadMoreRecentTopics({ uid: adminUid }, { after: 'invalid' }, function (err) {
|
||||
socketTopics.loadMoreSortedTopics({ uid: adminUid }, { after: 'invalid' }, function (err) {
|
||||
assert.equal(err.message, '[[error:invalid-data]]');
|
||||
done();
|
||||
});
|
||||
@@ -1091,7 +1091,7 @@ describe('Topic\'s', function () {
|
||||
|
||||
|
||||
it('should load more recent topics', function (done) {
|
||||
socketTopics.loadMoreRecentTopics({ uid: adminUid }, { cid: topic.categoryId, after: 0, count: 10 }, function (err, data) {
|
||||
socketTopics.loadMoreSortedTopics({ uid: adminUid }, { cid: topic.categoryId, after: 0, count: 10, sort: 'recent' }, function (err, data) {
|
||||
assert.ifError(err);
|
||||
assert(data);
|
||||
assert(Array.isArray(data.topics));
|
||||
|
||||
Reference in New Issue
Block a user