parent
aa78ca9535
commit
3815b9d4c6
@ -103,14 +103,16 @@ const Card: React.FC<Props> = (props) => {
|
||||
{t('admin.toggleVerification')}
|
||||
</a>
|
||||
<div className="dropdown-divider"></div>
|
||||
<a
|
||||
href="#"
|
||||
className="dropdown-item dropdown-item-danger"
|
||||
onClick={props.onDelete}
|
||||
>
|
||||
<i className="fas fa-trash mr-2"></i>
|
||||
{t('admin.deleteUser')}
|
||||
</a>
|
||||
{canModify && user.uid !== currentUser.uid && (
|
||||
<a
|
||||
href="#"
|
||||
className="dropdown-item dropdown-item-danger"
|
||||
onClick={props.onDelete}
|
||||
>
|
||||
<i className="fas fa-trash mr-2"></i>
|
||||
{t('admin.deleteUser')}
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
@ -101,7 +101,7 @@ const Row: React.FC<Props> = (props) => {
|
||||
</button>
|
||||
<button
|
||||
className="btn btn-danger"
|
||||
disabled={!canModify}
|
||||
disabled={!canModify || user.uid === currentUser.uid}
|
||||
onClick={props.onDelete}
|
||||
>
|
||||
{t('admin.deleteUser')}
|
||||
|
@ -221,7 +221,7 @@ describe('access control', () => {
|
||||
expect(queryByText(t('admin.changeScore'))).toBeInTheDocument()
|
||||
expect(queryByText(t('admin.changePermission'))).not.toBeInTheDocument()
|
||||
expect(queryByText(t('admin.toggleVerification'))).toBeInTheDocument()
|
||||
expect(queryByText(t('admin.deleteUser'))).toBeInTheDocument()
|
||||
expect(queryByText(t('admin.deleteUser'))).not.toBeInTheDocument()
|
||||
|
||||
fireEvent.click(getByTitle('Table Mode'))
|
||||
expect(queryByTitle(t('admin.changeEmail'))).toBeInTheDocument()
|
||||
@ -230,7 +230,7 @@ describe('access control', () => {
|
||||
expect(queryByTitle(t('admin.changePermission'))).not.toBeInTheDocument()
|
||||
expect(queryByTitle(t('admin.toggleVerification'))).toBeInTheDocument()
|
||||
expect(getByText(t('admin.changePassword'))).toBeEnabled()
|
||||
expect(getByText(t('admin.deleteUser'))).toBeEnabled()
|
||||
expect(getByText(t('admin.deleteUser'))).toBeDisabled()
|
||||
})
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user