1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-04 02:46:47 +01:00
immich/server/test/repositories/access.repository.mock.ts

34 lines
792 B
TypeScript
Raw Normal View History

import { IAccessRepository } from '@app/domain';
export interface IAccessRepositoryMock {
asset: jest.Mocked<IAccessRepository['asset']>;
album: jest.Mocked<IAccessRepository['album']>;
library: jest.Mocked<IAccessRepository['library']>;
person: jest.Mocked<IAccessRepository['person']>;
}
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(),
},
person: {
hasOwnerAccess: jest.fn(),
},
};
};