From ffc33bc263dc5105758d0a18832c09d2f2e1cd21 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 17 Apr 2025 16:41:00 -0400 Subject: [PATCH] test: article for new topic, note for replies --- test/activitypub/notes.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/test/activitypub/notes.js b/test/activitypub/notes.js index 3b33242d6f..ab3aa75271 100644 --- a/test/activitypub/notes.js +++ b/test/activitypub/notes.js @@ -298,6 +298,37 @@ describe('Notes', () => { assert(addressees.has(`${nconf.get('url')}/category/${cid}`)); }); + + it('should federate out an activity with object of type "Article"', () => { + assert(activity.object && activity.object.type); + assert.strictEqual(activity.object.type, 'Article'); + }); + }); + + describe('new reply', () => { + let activity; + + before(async () => { + const { tid } = await api.topics.create({ uid }, { + cid, + title: utils.generateUUID(), + content: utils.generateUUID(), + }); + activitypub._sent.clear(); + + const { pid } = await api.topics.reply({ uid }, { + tid, + content: utils.generateUUID(), + }); + + const key = Array.from(activitypub._sent.keys())[0]; + activity = activitypub._sent.get(key); + }); + + it('should federate out an activity with object of type "Note"', () => { + assert(activity.object && activity.object.type); + assert.strictEqual(activity.object.type, 'Note'); + }) }); });