You've already forked immich
mirror of
https://github.com/immich-app/immich.git
synced 2025-06-25 04:53:00 +02:00
20 lines
691 B
TypeScript
20 lines
691 B
TypeScript
![]() |
// 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();
|
||
|
});
|
||
|
});
|
||
|
});
|