mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat(server,web): Delete and restore user from the admin portal (#935)
* delete and restore user from admin UI * addressed review comments and fix e2e test * added cron job to delete user, and some formatting changes * addressed review comments * adding missing queue registration
This commit is contained in:
parent
948ff5530c
commit
fe4b307fe6
30 changed files with 804 additions and 59 deletions
19
server/libs/common/src/utils/user-utils.spec.ts
Normal file
19
server/libs/common/src/utils/user-utils.spec.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// create unit test for user utils
|
||||
|
||||
import { UserEntity } from '@app/database/entities/user.entity';
|
||||
import { userUtils } from './user-utils';
|
||||
|
||||
describe('User Utilities', () => {
|
||||
describe('checkIsReadyForDeletion', () => {
|
||||
it('check that user is not ready to be deleted', () => {
|
||||
const result = userUtils.isReadyForDeletion({ deletedAt: new Date() } as UserEntity);
|
||||
expect(result).toBeFalsy();
|
||||
});
|
||||
|
||||
it('check that user is ready to be deleted', () => {
|
||||
const aWeekAgo = new Date(new Date().getTime() - 8 * 86400000);
|
||||
const result = userUtils.isReadyForDeletion({ deletedAt: aWeekAgo } as UserEntity);
|
||||
expect(result).toBeTruthy();
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue