immich/server/test/repositories/user.repository.mock.ts

26 lines
646 B
TypeScript
Raw Normal View History

import { IUserRepository } from 'src/domain/repositories/user.repository';
import { UserCore } from 'src/domain/user/user.core';
export const newUserRepositoryMock = (reset = true): jest.Mocked<IUserRepository> => {
if (reset) {
UserCore.reset();
}
return {
get: jest.fn(),
getAdmin: jest.fn(),
getByEmail: jest.fn(),
getByStorageLabel: jest.fn(),
getByOAuthId: jest.fn(),
2023-03-21 19:49:19 -07:00
getUserStats: jest.fn(),
getList: jest.fn(),
create: jest.fn(),
update: jest.fn(),
delete: jest.fn(),
getDeletedUsers: jest.fn(),
hasAdmin: jest.fn(),
updateUsage: jest.fn(),
syncUsage: jest.fn(),
};
};