Mock fetching and updating settings for users tests

This commit is contained in:
Angelina Filippova 2020-08-28 13:29:11 +03:00
parent 58ba64b87a
commit 9eb5a1b347
2 changed files with 30 additions and 0 deletions

View file

@ -0,0 +1,29 @@
const configsWithoutTagPolicy = {
configs: [{
group: ':pleroma',
key: ':mrf',
value: [
{ tuple: [':policies', 'Pleroma.Web.ActivityPub.MRF.ObjectAgePolicy'] },
{ tuple: [':transparency', true] },
{ tuple: [':transparency_exclusions', []] }
] }],
need_reboot: false
}
const configAfterUpdate = {
configs: [{
db: [':policies'],
group: ':pleroma',
key: ':mrf',
value: [{ tuple: [':policies', ['Pleroma.Web.ActivityPub.MRF.ObjectAgePolicy', 'Pleroma.Web.ActivityPub.MRF.TagPolicy']] }]
}],
need_reboot: false
}
export async function fetchSettings(authHost, token) {
return Promise.resolve({ data: configsWithoutTagPolicy })
}
export async function updateSettings(configs, authHost, token) {
return Promise.resolve({ data: configAfterUpdate })
}

View file

@ -17,6 +17,7 @@ localVue.use(Element)
jest.mock('@/api/app') jest.mock('@/api/app')
jest.mock('@/api/nodeInfo') jest.mock('@/api/nodeInfo')
jest.mock('@/api/users') jest.mock('@/api/users')
jest.mock('@/api/settings')
describe('Search and filter users', () => { describe('Search and filter users', () => {
let store let store