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