Mock fetching and updating settings for users tests
This commit is contained in:
parent
58ba64b87a
commit
9eb5a1b347
2 changed files with 30 additions and 0 deletions
29
src/api/__mocks__/settings.js
Normal file
29
src/api/__mocks__/settings.js
Normal 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 })
|
||||
}
|
|
@ -17,6 +17,7 @@ localVue.use(Element)
|
|||
jest.mock('@/api/app')
|
||||
jest.mock('@/api/nodeInfo')
|
||||
jest.mock('@/api/users')
|
||||
jest.mock('@/api/settings')
|
||||
|
||||
describe('Search and filter users', () => {
|
||||
let store
|
||||
|
|
Loading…
Reference in a new issue