Skip to content

Node.js based forum software built for the modern web

fix: category follow schema test

Julian Lam4b8a9e58ae7b
diff --git a/public/openapi/write/categories/cid/follow.yaml b/public/openapi/write/categories/cid/follow.yaml
index cd8f8a0b96..4f54974d60 100644
--- a/public/openapi/write/categories/cid/follow.yaml
+++ b/public/openapi/write/categories/cid/follow.yaml
@@ -26,7 +26,7 @@ put:
actor:
type: string
description: A valid actor uri or webfinger handle
- example: '[email protected]'
+ example: 'https://example.org/foobar'
responses:
'200':
description: successfully sent category synchronization request
@@ -69,7 +69,7 @@ delete:
actor:
type: string
description: A valid actor uri or webfinger handle
- example: '[email protected]'
+ example: 'https://example.org/foobar'
responses:
'200':
description: successfully unsynchronized category
diff --git a/test/api.js b/test/api.js
index 857a5f8799..7575456863 100644
--- a/test/api.js
+++ b/test/api.js
@@ -23,6 +23,7 @@ const posts = require('../src/posts');
const plugins = require('../src/plugins');
const flags = require('../src/flags');
const messaging = require('../src/messaging');
+const activitypub = require('../src/activitypub');
const utils = require('../src/utils');
const api = require('../src/api');
@@ -317,6 +318,13 @@ describe('API', async () => {
// Retrieve CSRF token using cookie, to test Write API
csrfToken = await helpers.getCsrfToken(jar);
+ // Pre-seed ActivityPub cache so contrived actor assertions pass
+ activitypub._cache.set(`0;https://example.org/foobar`, {
+ id: 'https://example.org/foobar',
+ name: 'foobar',
+ publicKey: 'secretcat',
+ });
+
setup = true;
}