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
martin 9d01885b58
feat(server, web): Album's options (#4870)
* feat: disable activity

* fix: disable reactions

* fix: tests

* fix: tests

* fix: tests

* pr feedback

* pr feedback

* chore: styling & wording

* refactor component

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
2023-11-07 04:37:21 +00:00

54 lines
1.3 KiB
TypeScript

import { AccessCore, IAccessRepository } from '@app/domain';
export interface IAccessRepositoryMock {
activity: jest.Mocked<IAccessRepository['activity']>;
asset: jest.Mocked<IAccessRepository['asset']>;
album: jest.Mocked<IAccessRepository['album']>;
authDevice: jest.Mocked<IAccessRepository['authDevice']>;
library: jest.Mocked<IAccessRepository['library']>;
timeline: jest.Mocked<IAccessRepository['timeline']>;
person: jest.Mocked<IAccessRepository['person']>;
}
export const newAccessRepositoryMock = (reset = true): IAccessRepositoryMock => {
if (reset) {
AccessCore.reset();
}
return {
activity: {
hasOwnerAccess: jest.fn(),
hasAlbumOwnerAccess: jest.fn(),
hasCreateAccess: jest.fn(),
},
asset: {
hasOwnerAccess: jest.fn(),
hasAlbumAccess: jest.fn(),
hasPartnerAccess: jest.fn(),
hasSharedLinkAccess: jest.fn(),
},
album: {
hasOwnerAccess: jest.fn(),
hasSharedAlbumAccess: jest.fn(),
hasSharedLinkAccess: jest.fn(),
},
authDevice: {
hasOwnerAccess: jest.fn(),
},
library: {
hasOwnerAccess: jest.fn(),
hasPartnerAccess: jest.fn(),
},
timeline: {
hasPartnerAccess: jest.fn(),
},
person: {
hasOwnerAccess: jest.fn(),
},
};
};