summaryrefslogtreecommitdiff
path: root/packages/backend/test
diff options
context:
space:
mode:
authorKagami Sascha Rosylight <saschanaz@outlook.com>2023-08-08 06:26:03 +0200
committerGitHub <noreply@github.com>2023-08-08 13:26:03 +0900
commitec229dbd3b50fdb644dd9e6903e0544be21e55f1 (patch)
treeccd51a5ab2ad843722357e3a0f142bba48054139 /packages/backend/test
parentenhance(backend): Improve behavior of correctFilename (#11484) (diff)
downloadsharkey-ec229dbd3b50fdb644dd9e6903e0544be21e55f1.tar.gz
sharkey-ec229dbd3b50fdb644dd9e6903e0544be21e55f1.tar.bz2
sharkey-ec229dbd3b50fdb644dd9e6903e0544be21e55f1.zip
fix(backend/ApNoteService): try retrieving again when failed by duplication (#11472)
* fix(backend/ApNoteService): try retrieving again when failed by duplication * Update CHANGELOG.md --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
Diffstat (limited to 'packages/backend/test')
-rw-r--r--packages/backend/test/unit/activitypub.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/backend/test/unit/activitypub.ts b/packages/backend/test/unit/activitypub.ts
index 378f02e8e3..73209523b5 100644
--- a/packages/backend/test/unit/activitypub.ts
+++ b/packages/backend/test/unit/activitypub.ts
@@ -259,6 +259,21 @@ describe('ActivityPub', () => {
assert.strictEqual(note.text, 'test test foo');
assert.strictEqual(note.uri, actor2Note.id);
});
+
+ test('Fetch a note that is a featured note of the attributed actor', async () => {
+ const actor = createRandomActor();
+ actor.featured = `${actor.id}/collections/featured`;
+
+ const featured = createRandomFeaturedCollection(actor, 5);
+ const firstNote = (featured.items as NonTransientIPost[])[0];
+
+ resolver.register(actor.id, actor);
+ resolver.register(actor.featured, featured);
+ resolver.register(firstNote.id, firstNote);
+
+ const note = await noteService.createNote(firstNote.id as string, resolver);
+ assert.strictEqual(note?.uri, firstNote.id);
+ });
});
describe('Images', () => {