Update test mocks for api calls that toggle activation
This commit is contained in:
parent
42f73e6c79
commit
d0025dfe7a
1 changed files with 17 additions and 5 deletions
|
@ -33,11 +33,6 @@ export async function getPasswordResetToken(nickname, authHost, token) {
|
|||
return Promise.resolve({ data: { token: 'g05lxnBJQnL', link: 'http://url/api/pleroma/password_reset/g05lxnBJQnL' }})
|
||||
}
|
||||
|
||||
export async function toggleUserActivation(nickname, authHost, token) {
|
||||
const response = users.find(user => user.nickname === nickname)
|
||||
return Promise.resolve({ data: { ...response, deactivated: !response.deactivated }})
|
||||
}
|
||||
|
||||
export async function searchUsers(query, filters, authHost, token, page = 1) {
|
||||
const filteredUsers = filterUsers(filters)
|
||||
const response = filteredUsers.filter(user => user.nickname === query)
|
||||
|
@ -48,12 +43,29 @@ export async function searchUsers(query, filters, authHost, token, page = 1) {
|
|||
}})
|
||||
}
|
||||
|
||||
export async function activateUsers(nicknames, authHost, token) {
|
||||
const response = nicknames.map(nickname => {
|
||||
const currentUser = users.find(user => user.nickname === nickname)
|
||||
return { ...currentUser, deactivated: false }
|
||||
})
|
||||
return Promise.resolve({ data: response })
|
||||
}
|
||||
|
||||
export async function addRight(nicknames, right, authHost, token) {
|
||||
console.log(nicknames)
|
||||
return Promise.resolve({ data:
|
||||
{ [`is_${right}`]: true }
|
||||
})
|
||||
}
|
||||
|
||||
export async function deactivateUsers(nicknames, authHost, token) {
|
||||
const response = nicknames.map(nickname => {
|
||||
const currentUser = users.find(user => user.nickname === nickname)
|
||||
return { ...currentUser, deactivated: true }
|
||||
})
|
||||
return Promise.resolve({ data: response })
|
||||
}
|
||||
|
||||
export async function deleteRight(nickname, right, authHost, token) {
|
||||
return Promise.resolve({ data:
|
||||
{ [`is_${right}`]: false }
|
||||
|
|
Loading…
Reference in a new issue