mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
feat(web): Added admin user config to user settings (#15380)
* feat(web): Added admin user config to user settings * feat (web) - cleaned up the files and added tests * feat (web) - added missing files * feat (web) - updated per review comments * feat (web) - e2e admin command test failures
This commit is contained in:
parent
22eef5f3c5
commit
e5219f1f31
15 changed files with 308 additions and 20 deletions
|
|
@ -118,7 +118,7 @@ describe('/admin/users', () => {
|
|||
});
|
||||
}
|
||||
|
||||
it('should ignore `isAdmin`', async () => {
|
||||
it('should accept `isAdmin`', async () => {
|
||||
const { status, body } = await request(app)
|
||||
.post(`/admin/users`)
|
||||
.send({
|
||||
|
|
@ -130,7 +130,7 @@ describe('/admin/users', () => {
|
|||
.set('Authorization', `Bearer ${admin.accessToken}`);
|
||||
expect(body).toMatchObject({
|
||||
email: 'user5@immich.cloud',
|
||||
isAdmin: false,
|
||||
isAdmin: true,
|
||||
shouldChangePassword: true,
|
||||
});
|
||||
expect(status).toBe(201);
|
||||
|
|
@ -163,14 +163,15 @@ describe('/admin/users', () => {
|
|||
});
|
||||
}
|
||||
|
||||
it('should not allow a non-admin to become an admin', async () => {
|
||||
it('should allow a non-admin to become an admin', async () => {
|
||||
const user = await utils.userSetup(admin.accessToken, createUserDto.create('admin2'));
|
||||
const { status, body } = await request(app)
|
||||
.put(`/admin/users/${nonAdmin.userId}`)
|
||||
.put(`/admin/users/${user.userId}`)
|
||||
.send({ isAdmin: true })
|
||||
.set('Authorization', `Bearer ${admin.accessToken}`);
|
||||
|
||||
expect(status).toBe(200);
|
||||
expect(body).toMatchObject({ isAdmin: false });
|
||||
expect(body).toMatchObject({ isAdmin: true });
|
||||
});
|
||||
|
||||
it('ignores updates to profileImagePath', async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue