mirror of
https://github.com/immich-app/immich.git
synced 2025-01-01 08:31:59 +00:00
3b37b70626
* feat: user license endpoints * feat: server license endpoints * chore: pr feedback * chore: add more test cases * chore: add prod license public keys * chore: open-api generation
28 lines
760 B
TypeScript
28 lines
760 B
TypeScript
import { UserCore } from 'src/cores/user.core';
|
|
import { IUserRepository } from 'src/interfaces/user.interface';
|
|
import { Mocked, vitest } from 'vitest';
|
|
|
|
export const newUserRepositoryMock = (reset = true): Mocked<IUserRepository> => {
|
|
if (reset) {
|
|
UserCore.reset();
|
|
}
|
|
|
|
return {
|
|
get: vitest.fn(),
|
|
getAdmin: vitest.fn(),
|
|
getByEmail: vitest.fn(),
|
|
getByStorageLabel: vitest.fn(),
|
|
getByOAuthId: vitest.fn(),
|
|
getUserStats: vitest.fn(),
|
|
getList: vitest.fn(),
|
|
create: vitest.fn(),
|
|
update: vitest.fn(),
|
|
delete: vitest.fn(),
|
|
getDeletedUsers: vitest.fn(),
|
|
hasAdmin: vitest.fn(),
|
|
updateUsage: vitest.fn(),
|
|
syncUsage: vitest.fn(),
|
|
upsertMetadata: vitest.fn(),
|
|
deleteMetadata: vitest.fn(),
|
|
};
|
|
};
|