2024-03-20 11:32:04 -07:00
|
|
|
import { IUserRepository } from 'src/domain/repositories/user.repository';
|
|
|
|
import { UserCore } from 'src/domain/user/user.core';
|
2023-10-23 05:38:48 -07:00
|
|
|
|
|
|
|
export const newUserRepositoryMock = (reset = true): jest.Mocked<IUserRepository> => {
|
|
|
|
if (reset) {
|
|
|
|
UserCore.reset();
|
|
|
|
}
|
2023-01-18 07:40:15 -07:00
|
|
|
|
|
|
|
return {
|
|
|
|
get: jest.fn(),
|
|
|
|
getAdmin: jest.fn(),
|
|
|
|
getByEmail: jest.fn(),
|
2023-05-21 20:18:10 -07:00
|
|
|
getByStorageLabel: jest.fn(),
|
2023-01-18 07:40:15 -07:00
|
|
|
getByOAuthId: jest.fn(),
|
2023-03-21 19:49:19 -07:00
|
|
|
getUserStats: jest.fn(),
|
2023-01-18 07:40:15 -07:00
|
|
|
getList: jest.fn(),
|
|
|
|
create: jest.fn(),
|
|
|
|
update: jest.fn(),
|
|
|
|
delete: jest.fn(),
|
2023-02-25 07:12:03 -07:00
|
|
|
getDeletedUsers: jest.fn(),
|
2023-10-10 19:37:13 -07:00
|
|
|
hasAdmin: jest.fn(),
|
2024-01-12 17:43:36 -07:00
|
|
|
updateUsage: jest.fn(),
|
|
|
|
syncUsage: jest.fn(),
|
2023-01-18 07:40:15 -07:00
|
|
|
};
|
|
|
|
};
|