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