0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-07 00:50:23 -05:00
immich/server/test/repositories/access.repository.mock.ts
Daniel Dietzler 1a633f3fca
chore(server): Use access core for person permissions (#4138)
* use access core for all person methods

* minor fixes, feedback

* reorder assignments

* remove unnecessary permission requirement

* unify naming of tests

* reorder variables
2023-09-18 21:22:44 +00:00

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(),
},
};
};