mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
test: refactor tests to support additional Note tests
This commit is contained in:
@@ -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', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user