Ghost/ghost/core/test/e2e-api/admin/mentions.test.js
Simon Backx 64b472166c Removed required webmentions flag for mentions admin endpoint
fixes https://github.com/TryGhost/Product/issues/3830

This endpoint is required for recommendations to work: admin-x loads the incoming recommendations by querying the mentions endpoint. If the mentions flag was not enabled, this endpoint wasn't available.
2023-09-19 17:31:55 +02:00

34 lines
946 B
JavaScript

const {agentProvider, fixtureManager, mockManager, matchers} = require('../../utils/e2e-framework');
const {anyObjectId, anyISODateTime, anyString} = matchers;
const matchMentionShallowIncludes = {
id: anyObjectId,
source: anyString,
target: anyString,
timestamp: anyISODateTime,
source_title: anyString
};
describe('Mentions API', function () {
let agent;
before(async function () {
agent = await agentProvider.getAdminAPIAgent();
// TODO: test various users' access
await fixtureManager.init('users','mentions');
await agent.loginAsOwner();
});
afterEach(function () {
mockManager.restore();
});
it('Can browse with limits', async function () {
await agent.get('mentions/?limit=2')
.expectStatus(200)
.matchBodySnapshot({
mentions: new Array(2).fill(matchMentionShallowIncludes)
});
});
});