mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-26 16:41:21 +01:00
test: fix tests to account for a460a55064
This commit is contained in:
@@ -451,7 +451,7 @@ describe('Notes', () => {
|
|||||||
assert.strictEqual(cid, -1);
|
assert.strictEqual(cid, -1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create a new topic in cid -1 even if a remote category is addressed', async () => {
|
it('should create a new topic in a remote category if addressed (category same-origin)', async () => {
|
||||||
const { id: remoteCid } = helpers.mocks.group();
|
const { id: remoteCid } = helpers.mocks.group();
|
||||||
const { note, id } = helpers.mocks.note({
|
const { note, id } = helpers.mocks.note({
|
||||||
audience: [remoteCid],
|
audience: [remoteCid],
|
||||||
@@ -462,6 +462,23 @@ describe('Notes', () => {
|
|||||||
|
|
||||||
assert(await posts.exists(id));
|
assert(await posts.exists(id));
|
||||||
|
|
||||||
|
const cid = await posts.getCidByPid(id);
|
||||||
|
assert.strictEqual(cid, remoteCid);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create a new topic in cid -1 if a non-same origin remote category is addressed', async () => {
|
||||||
|
const { id: remoteCid } = helpers.mocks.group({
|
||||||
|
id: `https://example.com/${utils.generateUUID()}`,
|
||||||
|
});
|
||||||
|
const { note, id } = helpers.mocks.note({
|
||||||
|
audience: [remoteCid],
|
||||||
|
});
|
||||||
|
const { activity } = helpers.mocks.create(note);
|
||||||
|
|
||||||
|
await activitypub.inbox.create({ body: activity });
|
||||||
|
|
||||||
|
assert(await posts.exists(id));
|
||||||
|
|
||||||
const cid = await posts.getCidByPid(id);
|
const cid = await posts.getCidByPid(id);
|
||||||
assert.strictEqual(cid, -1);
|
assert.strictEqual(cid, -1);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user