2023-10-23 12:37:51 +00:00
|
|
|
import { AccessCore, IAccessRepository } from '@app/domain';
|
2023-06-06 20:18:38 +00:00
|
|
|
|
2023-08-24 19:28:50 +00:00
|
|
|
export interface IAccessRepositoryMock {
|
2023-11-01 03:13:34 +00:00
|
|
|
activity: jest.Mocked<IAccessRepository['activity']>;
|
2023-06-28 13:56:24 +00:00
|
|
|
asset: jest.Mocked<IAccessRepository['asset']>;
|
|
|
|
album: jest.Mocked<IAccessRepository['album']>;
|
2023-10-30 15:48:38 +00:00
|
|
|
authDevice: jest.Mocked<IAccessRepository['authDevice']>;
|
2023-06-28 13:56:24 +00:00
|
|
|
library: jest.Mocked<IAccessRepository['library']>;
|
2023-09-20 11:16:33 +00:00
|
|
|
timeline: jest.Mocked<IAccessRepository['timeline']>;
|
2023-09-18 21:22:44 +00:00
|
|
|
person: jest.Mocked<IAccessRepository['person']>;
|
2023-08-24 19:28:50 +00:00
|
|
|
}
|
2023-06-28 13:56:24 +00:00
|
|
|
|
2023-10-23 12:37:51 +00:00
|
|
|
export const newAccessRepositoryMock = (reset = true): IAccessRepositoryMock => {
|
|
|
|
if (reset) {
|
|
|
|
AccessCore.reset();
|
|
|
|
}
|
|
|
|
|
2023-06-06 20:18:38 +00:00
|
|
|
return {
|
2023-11-01 03:13:34 +00:00
|
|
|
activity: {
|
|
|
|
hasOwnerAccess: jest.fn(),
|
|
|
|
hasAlbumOwnerAccess: jest.fn(),
|
2023-11-07 04:37:21 +00:00
|
|
|
hasCreateAccess: jest.fn(),
|
2023-11-01 03:13:34 +00:00
|
|
|
},
|
2023-06-28 13:56:24 +00:00
|
|
|
asset: {
|
|
|
|
hasOwnerAccess: jest.fn(),
|
|
|
|
hasAlbumAccess: jest.fn(),
|
|
|
|
hasPartnerAccess: jest.fn(),
|
|
|
|
hasSharedLinkAccess: jest.fn(),
|
|
|
|
},
|
2023-06-21 01:08:43 +00:00
|
|
|
|
2023-06-28 13:56:24 +00:00
|
|
|
album: {
|
|
|
|
hasOwnerAccess: jest.fn(),
|
|
|
|
hasSharedAlbumAccess: jest.fn(),
|
|
|
|
hasSharedLinkAccess: jest.fn(),
|
|
|
|
},
|
2023-06-21 01:08:43 +00:00
|
|
|
|
2023-10-30 15:48:38 +00:00
|
|
|
authDevice: {
|
|
|
|
hasOwnerAccess: jest.fn(),
|
|
|
|
},
|
|
|
|
|
2023-06-28 13:56:24 +00:00
|
|
|
library: {
|
2023-09-20 11:16:33 +00:00
|
|
|
hasOwnerAccess: jest.fn(),
|
|
|
|
hasPartnerAccess: jest.fn(),
|
|
|
|
},
|
|
|
|
|
|
|
|
timeline: {
|
2023-06-28 13:56:24 +00:00
|
|
|
hasPartnerAccess: jest.fn(),
|
|
|
|
},
|
2023-09-18 21:22:44 +00:00
|
|
|
|
|
|
|
person: {
|
|
|
|
hasOwnerAccess: jest.fn(),
|
|
|
|
},
|
2023-06-06 20:18:38 +00:00
|
|
|
};
|
|
|
|
};
|