make kestrel a tak server, so that it can send and receive pois as cots data
Some checks failed
ci/woodpecker/pr/pr Pipeline failed
Some checks failed
ci/woodpecker/pr/pr Pipeline failed
This commit is contained in:
@@ -16,4 +16,22 @@ describe('members page', () => {
|
||||
const wrapper = await mountSuspended(Members)
|
||||
expect(wrapper.text()).toMatch(/Sign in to view members/)
|
||||
})
|
||||
|
||||
it('shows members list and Add user when user is admin', async () => {
|
||||
registerEndpoint('/api/me', () => ({ id: '1', identifier: 'admin', role: 'admin', avatar_url: null }), { method: 'GET' })
|
||||
registerEndpoint('/api/users', () => [])
|
||||
const wrapper = await mountSuspended(Members)
|
||||
await new Promise(r => setTimeout(r, 100))
|
||||
expect(wrapper.text()).toContain('Add user')
|
||||
expect(wrapper.text()).toMatch(/Only admins can change roles/)
|
||||
})
|
||||
|
||||
it('shows members content when user has canEditPois (leader)', async () => {
|
||||
registerEndpoint('/api/me', () => ({ id: '2', identifier: 'leader', role: 'leader', avatar_url: null }), { method: 'GET' })
|
||||
registerEndpoint('/api/users', () => [])
|
||||
const wrapper = await mountSuspended(Members)
|
||||
await new Promise(r => setTimeout(r, 150))
|
||||
expect(wrapper.text()).toContain('Members')
|
||||
expect(wrapper.text()).toContain('Identifier')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user