test: fix unread deleted topic test (#14164)

instead of posting and immediately deleting, add a deleted param to topics.post which deletes the topic before sending notifications
This commit is contained in:
Barış Uşaklı
2026-04-10 13:05:29 -04:00
committed by GitHub
parent 167ba83033
commit 3915790793
2 changed files with 12 additions and 5 deletions

View File

@@ -1420,8 +1420,14 @@ describe('Topic\'s', () => {
it('should not return topic as unread if topic is deleted', async () => {
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 result = await topics.post({
uid: adminUid,
title: 'deleted unread',
content: 'not unread',
cid: categoryObj.cid,
deleted: 1,
});
const unreadTids = await topics.getUnreadTids({ cid: 0, uid: uid });
await sleep(2000);