You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.0 KiB
38 lines
1.0 KiB
import activityPubUser from './responses/activitypub/users.json';
|
|
import identities from './responses/ghost/identities.json';
|
|
import ownerUser from './responses/ghost/users.json';
|
|
import site from './responses/ghost/site.json';
|
|
import {Page} from '@playwright/test';
|
|
import {mockApi} from '@tryghost/admin-x-framework/test/acceptance';
|
|
|
|
const initialAdminApiRequests = {
|
|
getStaffUser: {
|
|
method: 'GET',
|
|
path: /users\/me\/?(\?.*)?/,
|
|
response: ownerUser
|
|
},
|
|
getSite: {
|
|
method: 'GET',
|
|
path: '/site',
|
|
response: site
|
|
},
|
|
getIdentities: {
|
|
method: 'GET',
|
|
path: '/identities/',
|
|
response: identities
|
|
}
|
|
};
|
|
|
|
const initialActivityPubRequests = {
|
|
getActivityPubUser: {
|
|
method: 'GET',
|
|
path: '/users/index',
|
|
response: activityPubUser
|
|
}
|
|
};
|
|
|
|
export async function mockInitialApiRequests(page: Page) {
|
|
await mockApi({page, requests: initialAdminApiRequests});
|
|
await mockApi({page, requests: initialActivityPubRequests, options: {useActivityPub: true}});
|
|
}
|