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