diff --git a/UserGuide.md b/UserGuide.md index e69de29bb2..dfab4c6489 100644 --- a/UserGuide.md +++ b/UserGuide.md @@ -0,0 +1,15 @@ +# All Features +## Feature 1: Endorse By Staff Feature + +## Feature 2: Quick Anonymous Reply +### How to use? +[**This video shows how to use this feature!**](https://github.com/user-attachments/assets/6fd3c1cb-006e-4dc0-a449-10fb6a254b44) + +### How to test? +This feature is triggered by the UI when the user clicks on the "**Anonymous Reply**" button. We are not doing UI level automated testing, rather we are testing the backend. Next time, we use tools, like Puppeteer, that can implement UI automated tests. + +To test backend: +**We added a test case in `test/topics.js` (line starting from 271)** + +**Why we believe this works:** +Anonymous reply only required one extra backend parameter (**handle == 1**), and we tested exactly for that condition. \ No newline at end of file diff --git a/test/topics.js b/test/topics.js index 8a32e445f5..6f76435aba 100644 --- a/test/topics.js +++ b/test/topics.js @@ -48,7 +48,7 @@ describe('Topic\'s', () => { topic = { userId: adminUid, categoryId: categoryObj.cid, - title: 'Test Topic Title', + title: 'Test Topic Title2025', content: 'The content of test topic', }; }); @@ -268,6 +268,15 @@ describe('Topic\'s', () => { }); }); + it('should create a new anonymous reply with proper parameters', (done) => { + topics.reply({ uid: topic.userId, content: 'test post1234', tid: newTopic.tid, handle: 1 }, (err, result) => { + assert.equal(err, null, 'was created with error'); + assert.ok(result); + + done(); + }); + }); + it('should handle direct replies', async () => { const result = await topics.reply({ uid: topic.userId, content: 'test reply', tid: newTopic.tid, toPid: newPost.pid }); assert.ok(result);