From feb9421507f2d3b3c0f8ba7aefba3775ca19a54d Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 3 Mar 2025 11:20:41 -0500 Subject: [PATCH] test: add failing test for #13215 --- test/activitypub/feps.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/test/activitypub/feps.js b/test/activitypub/feps.js index 59ef838fa9..02b484ad9e 100644 --- a/test/activitypub/feps.js +++ b/test/activitypub/feps.js @@ -22,7 +22,7 @@ describe('FEPs', () => { await install.giveWorldPrivileges(); }); - describe('1b12', () => { + describe.only('1b12', () => { describe('announceObject()', () => { let cid; let uid; @@ -44,6 +44,10 @@ describe('FEPs', () => { activitypub._sent.clear(); }); + afterEach(() => { + activitypub._sent.clear(); + }); + it('should be called when a topic is moved from uncategorized to another category', async () => { const { topicData } = await topics.post({ uid, @@ -61,6 +65,25 @@ describe('FEPs', () => { assert.strictEqual(activitypub._sent.size, 1); }); + + it('should be called for a newly forked topic', async () => { + const { topicData } = await topics.post({ + uid, + cid: -1, + title: utils.generateUUID(), + content: utils.generateUUID(), + }); + const { tid } = topicData; + const [{ pid: reply1Pid }, { pid: reply2Pid }] = await Promise.all([ + topics.reply({ uid, tid, content: utils.generateUUID() }), + topics.reply({ uid, tid, content: utils.generateUUID() }), + ]); + const forked = await topics.createTopicFromPosts( + adminUid, utils.generateUUID(), [reply1Pid, reply2Pid], tid, cid + ); + + assert.strictEqual(activitypub._sent.size, 1); + }); }); }); });