Skip to content

Node.js based forum software built for the modern web

test: fix groups:find webfinger test

Julian Lam0c1a61839efc
diff --git a/test/activitypub/privileges.js b/test/activitypub/privileges.js
index 2284b7203d..1c8d2ec7f2 100644
--- a/test/activitypub/privileges.js
+++ b/test/activitypub/privileges.js
@@ -4,6 +4,7 @@ const assert = require('assert');
const nconf = require('nconf');
const db = require('../mocks/databasemock');
+const request = require('../../src/request');
const user = require('../../src/user');
const topics = require('../../src/topics');
const posts = require('../../src/posts');
@@ -192,11 +193,12 @@ describe('Privilege logic for remote users/content (ActivityPub)', () => {
describe('groups:find', () => {
it('should return webfinger response to a category\'s handle', async () => {
- const response = await activitypub.helpers.query(`${handle}@${nconf.get('url_parsed').hostname}`);
+ const { response, body } = await request.get(`${nconf.get('url')}/.well-known/webfinger?resource=acct:${handle}@${nconf.get('url_parsed').host}`);
assert(response);
- assert.strictEqual(response.subject, `acct:${handle}@${nconf.get('url_parsed').hostname}`);
- assert.strictEqual(response.hostname, nconf.get('url_parsed').hostname);
+ assert.strictEqual(response.statusCode, 200);
+ assert(body.links && body.links.length);
+ assert.strictEqual(body.subject, `acct:${handle}@${nconf.get('url_parsed').host}`);
});
});
});