Node.js based forum software built for the modern web
test: one more getTopicPosts test
Barış Soner Uşaklıf8f0a83b52a6
diff --git a/test/topics.js b/test/topics.jsindex 48b9469365..5a2db3ce15 100644--- a/test/topics.js+++ b/test/topics.js@@ -543,6 +543,16 @@ describe('Topic\'s', () => {assert.strictEqual(data.posts[0].content, 'topic reply 5');assert.strictEqual(data.posts[1].content, 'topic reply 6');});++ it('should return all posts in correct order', async () => {+ const topicData = await topics.getTopicData(tid);+ const postsData = await topics.getTopicPosts(topicData, `tid:${tid}:posts`, 0, -1, topic.userId, false);+ assert.strictEqual(postsData.length, 31);+ assert.strictEqual(postsData[0].content, 'main post');+ for (let i = 1; i < 30; i++) {+ assert.strictEqual(postsData[i].content, `topic reply ${i}`);+ }+ });});});