test: refactor tests to support additional Note tests

This commit is contained in:
Julian Lam
2024-05-07 11:56:58 -04:00
parent 2cd9088c8d
commit 0c0f01b560

View File

@@ -361,29 +361,29 @@ describe('ActivityPub integration', () => {
});
describe('Serving of local assets to remote clients', () => {
let category;
describe('Note', () => {
let cid;
let uid;
let postData;
let topicData;
before(async () => {
category = await categories.create({ name: utils.generateUUID().slice(0, 8) });
({ cid } = await categories.create({ name: utils.generateUUID().slice(0, 8) }));
const slug = slugify(utils.generateUUID().slice(0, 8));
uid = await user.create({ username: slug });
});
({ postData, topicData } = await topics.post({
describe('Existing and resolvable', () => {
let body;
let response;
let postData;
before(async () => {
({ postData } = await topics.post({
uid,
cid: category.cid,
cid,
title: 'Lorem "Lipsum" Ipsum',
content: 'Lorem ipsum dolor sit amet',
}));
});
describe('Note', () => {
let body;
let response;
before(async () => {
({ body, response } = await request.get(`${nconf.get('url')}/post/${postData.pid}`, {
headers: {
Accept: 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"',
@@ -413,6 +413,11 @@ describe('ActivityPub integration', () => {
assert.strictEqual(body.name, 'Lorem "Lipsum" Ipsum');
});
});
describe('Soft deleted', () => {
});
});
});
describe('Actor asserton', () => {