mirror of
https://github.com/immich-app/immich.git
synced 2025-01-06 11:56:46 +01:00
06ce8247cc
* feat(server): user metadata * add missing method to user mock * update migration to include cascades * update sql files * test: fix e2e * chore: clean up --------- Co-authored-by: Daniel Dietzler <mail@ddietzler.dev>
27 lines
727 B
TypeScript
27 lines
727 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(),
|
|
};
|
|
};
|