1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-01 08:31:59 +00:00
immich/server/test/repositories/access.repository.mock.ts

29 lines
683 B
TypeScript
Raw Normal View History

import { IAccessRepository } from '@app/domain';
export type IAccessRepositoryMock = {
asset: jest.Mocked<IAccessRepository['asset']>;
album: jest.Mocked<IAccessRepository['album']>;
library: jest.Mocked<IAccessRepository['library']>;
};
export const newAccessRepositoryMock = (): IAccessRepositoryMock => {
return {
asset: {
hasOwnerAccess: jest.fn(),
hasAlbumAccess: jest.fn(),
hasPartnerAccess: jest.fn(),
hasSharedLinkAccess: jest.fn(),
},
album: {
hasOwnerAccess: jest.fn(),
hasSharedAlbumAccess: jest.fn(),
hasSharedLinkAccess: jest.fn(),
},
library: {
hasPartnerAccess: jest.fn(),
},
};
};