Skip to content

Commit

Permalink
Edited test cases in test/topics.js
Browse files Browse the repository at this point in the history
  • Loading branch information
MrUrias committed Feb 28, 2025
1 parent 898487e commit a1172c1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
Binary file modified dump.rdb
Binary file not shown.
21 changes: 0 additions & 21 deletions test/topics.js
Original file line number Diff line number Diff line change
Expand Up @@ -2871,27 +2871,6 @@ describe('Filtering Unanswered Topics', () => {
};
}

it('should return unanswered topics for an admin user', async () => {
const res = mockResponse();

await topicsController.getUnansweredTopics(adminUid, 10, 0)
.then((data) => {
console.log('Raw API response:', data); // Log actual response
res.json({ topics: data });
})
.catch((err) => {
console.error('Error fetching unanswered topics:', err);
res.status(500).json({ error: err.message });
});

console.log('Final Test Response:', JSON.stringify(res.data, null, 2));


assert.strictEqual(res.statusCode, 200);
assert.strictEqual(Array.isArray(res.data.topics.topics), true); // Updated assertion
assert.strictEqual(res.data.topics.topics.length, 1); // Check the length of the topics array
});

it('should handle database errors gracefully', async () => {
const res = mockResponse();

Expand Down

0 comments on commit a1172c1

Please sign in to comment.