mirror of
https://github.com/immich-app/immich.git
synced 2025-01-07 00:50:23 -05:00
1a633f3fca
* use access core for all person methods * minor fixes, feedback * reorder assignments * remove unnecessary permission requirement * unify naming of tests * reorder variables
33 lines
792 B
TypeScript
33 lines
792 B
TypeScript
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(),
|
|
},
|
|
};
|
|
};
|