Skip to content
Snippets Groups Projects
Commit f89fbd53 authored by Angelina Filippova's avatar Angelina Filippova
Browse files

Add test for revoking password token

parent dd657d5c
No related branches found
No related tags found
1 merge request!45Generate invite tokens from admin-fe
This commit is part of merge request !45. Comments created here will be created in the context of that merge request.
...@@ -29,6 +29,10 @@ export async function fetchUsers(filters, authHost, token, page = 1) { ...@@ -29,6 +29,10 @@ export async function fetchUsers(filters, authHost, token, page = 1) {
}}) }})
} }
export async function getPasswordResetToken(nickname, authHost, token) {
return Promise.resolve({ data: 'g05lxnBJQnL' })
}
export async function toggleUserActivation(nickname, authHost, token) { export async function toggleUserActivation(nickname, authHost, token) {
const response = users.find(user => user.nickname === nickname) const response = users.find(user => user.nickname === nickname)
return Promise.resolve({ data: { ...response, deactivated: !response.deactivated }}) return Promise.resolve({ data: { ...response, deactivated: !response.deactivated }})
......
...@@ -238,6 +238,24 @@ describe('Users actions', () => { ...@@ -238,6 +238,24 @@ describe('Users actions', () => {
expect(secondUserNicknameAfterToggle).toEqual('bob') expect(secondUserNicknameAfterToggle).toEqual('bob')
done() done()
}) })
it('creates password revoke token', async (done) => {
const wrapper = mount(Users, {
store,
localVue,
sync: false,
stubs: ['router-link']
})
await flushPromises()
expect(store.state.users.passwordResetToken).toBe('')
wrapper.find(htmlElement(1, 11)).trigger('click')
await flushPromises()
expect(store.state.users.passwordResetToken).toBe('g05lxnBJQnL')
done()
})
}) })
describe('Creates new account', () => { describe('Creates new account', () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment