diff --git a/admin/src/components/ChangeUserRoleFormular.spec.js b/admin/src/components/ChangeUserRoleFormular.spec.js index 7df3209ed..ccb5c0587 100644 --- a/admin/src/components/ChangeUserRoleFormular.spec.js +++ b/admin/src/components/ChangeUserRoleFormular.spec.js @@ -52,7 +52,7 @@ describe('ChangeUserRoleFormular', () => { wrapper = Wrapper() }) - it('a DIV element with the class.delete-user-formular', () => { + it('has a DIV element with the class.delete-user-formular', () => { expect(wrapper.find('.change-user-role-formular').exists()).toBe(true) }) }) @@ -72,7 +72,7 @@ describe('ChangeUserRoleFormular', () => { expect(wrapper.text()).toContain('userRole.notChangeYourSelf') }) - it('role select is disabled', () => { + it('has role select disabled', () => { expect(wrapper.find('select[disabled="disabled"]').exists()).toBe(true) }) }) @@ -104,7 +104,7 @@ describe('ChangeUserRoleFormular', () => { expect(wrapper.find('select.role-select').exists()).toBe(true) }) - it('role select is enabled', () => { + it('has role select enabled', () => { expect(wrapper.find('select.role-select[disabled="disabled"]').exists()).toBe(false) }) @@ -138,13 +138,13 @@ describe('ChangeUserRoleFormular', () => { rolesToSelect = wrapper.find('select.role-select').findAll('option') }) - it('select is set to "usual user"', () => { + it('has selected option set to "usual user"', () => { expect(wrapper.find('select.role-select').element.value).toBe('user') }) describe('change select to', () => { describe('same role', () => { - it('not calling the API', () => { + it('does not call the API', () => { rolesToSelect.at(0).setSelected() expect(apolloMutateMock).not.toHaveBeenCalled() }) @@ -204,13 +204,13 @@ describe('ChangeUserRoleFormular', () => { rolesToSelect = wrapper.find('select.role-select').findAll('option') }) - it('select is set to "admin"', () => { + it('has selected option set to "admin"', () => { expect(wrapper.find('select.role-select').element.value).toBe('admin') }) describe('change select to', () => { describe('same role', () => { - it('not calling the API', () => { + it('does not call the API', () => { rolesToSelect.at(1).setSelected() expect(apolloMutateMock).not.toHaveBeenCalled() }) diff --git a/backend/src/graphql/resolver/AdminResolver.test.ts b/backend/src/graphql/resolver/AdminResolver.test.ts index 2993c216f..404ed519e 100644 --- a/backend/src/graphql/resolver/AdminResolver.test.ts +++ b/backend/src/graphql/resolver/AdminResolver.test.ts @@ -141,7 +141,7 @@ describe('AdminResolver', () => { }) describe('user gets new role', () => { - describe('is admin', () => { + describe('to admin', () => { it('returns date string', async () => { const result = await mutate({ mutation: setUserRole, @@ -158,8 +158,8 @@ describe('AdminResolver', () => { }) }) - describe('is usual user', () => { - it('returns string', async () => { + describe('to usual user', () => { + it('returns null', async () => { await expect( mutate({ mutation: setUserRole, variables: { userId: user.id, isAdmin: false } }), ).resolves.toEqual( @@ -188,7 +188,7 @@ describe('AdminResolver', () => { }) describe('user has already role to be set', () => { - describe('is admin', () => { + describe('to admin', () => { it('throws an error', async () => { await mutate({ mutation: setUserRole, @@ -204,7 +204,7 @@ describe('AdminResolver', () => { }) }) - describe('is usual user', () => { + describe('to usual user', () => { it('throws an error', async () => { await mutate({ mutation: setUserRole,