More tests, make Delete objects work

This commit is contained in:
Jesse Wierzbinski 2023-09-14 17:42:52 -10:00
parent 76b1b8c3b4
commit bc6873422f
No known key found for this signature in database
GPG key ID: F9A1E418934E40B0
2 changed files with 67 additions and 20 deletions

View file

@ -171,7 +171,7 @@ describe("POST /@test/inbox", () => {
"@context": "https://www.w3.org/ns/activitystreams",
id: "https://example.com/notes/1",
type: "Note",
content: "This note has been deleted!",
content: "This note has been edited!",
summary: null,
inReplyTo: null,
published: "2021-01-01T00:00:00.000Z",
@ -204,7 +204,12 @@ describe("POST /@test/inbox", () => {
published: "2021-01-03T00:00:00.000Z",
});
expect(activity?.objects).toHaveLength(0);
// Can be 0 or 1 length depending on whether config.activitypub.use_tombstone is true or false
if (config.activitypub.use_tombstones) {
expect(activity?.objects).toHaveLength(1);
} else {
expect(activity?.objects).toHaveLength(0);
}
});
});