fix: don't show deleted topics on unread

This commit is contained in:
Barış Soner Uşaklı
2019-10-09 18:03:07 -04:00
parent 6b3eb0144e
commit 661a0f5068
2 changed files with 13 additions and 12 deletions

View File

@@ -1461,6 +1461,14 @@ describe('Topic\'s', function () {
},
], done);
});
it('should not return topic as unread if topic is deleted', async function () {
const uid = await User.create({ username: 'regularJoe' });
const result = await topics.post({ uid: adminUid, title: 'deleted unread', content: 'not unread', cid: categoryObj.cid });
await topics.delete(result.topicData.tid, adminUid);
const unreadTids = await topics.getUnreadTids({ cid: 0, uid: uid });
assert(!unreadTids.includes(result.topicData.tid));
});
});
describe('tags', function () {