mirror of
https://github.com/immich-app/immich.git
synced 2024-12-23 02:06:15 +02:00
e98398cab8
* refactor: access repo interface * feat: access core * fix: allow shared links to add to a shared link * chore: comment out unused code * fix: pr feedback --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
29 lines
683 B
TypeScript
29 lines
683 B
TypeScript
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(),
|
|
},
|
|
};
|
|
};
|