mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
test that moderator cannot change roles
This commit is contained in:
parent
1d2bb05069
commit
2de0b620c0
@ -296,7 +296,6 @@ describe('ChangeUserRoleFormular', () => {
|
||||
|
||||
describe('user has role "moderator"', () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks()
|
||||
apolloMutateMock.mockResolvedValue({
|
||||
data: {
|
||||
setUserRole: null,
|
||||
@ -650,5 +649,23 @@ describe('ChangeUserRoleFormular', () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('authenticated user is MODERATOR', () => {
|
||||
beforeEach(() => {
|
||||
mocks.$store.state.moderator.roles = ['MODERATOR']
|
||||
})
|
||||
|
||||
it('displays text with role', () => {
|
||||
expect(wrapper.text()).toBe('userRole.selectRoles.admin')
|
||||
})
|
||||
|
||||
it('has no role select', () => {
|
||||
expect(wrapper.find('select.role-select').exists()).toBe(false)
|
||||
})
|
||||
|
||||
it('has no button', () => {
|
||||
expect(wrapper.find('button.btn.btn-dange').exists()).toBe(false)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user