mirror of
https://github.com/immich-app/immich.git
synced 2025-01-10 13:56:47 +01:00
30f499cf2e
update server to use absolute import paths
61 lines
2 KiB
TypeScript
61 lines
2 KiB
TypeScript
import { AccessCore } from 'src/domain/access/access.core';
|
|
import { IAccessRepository } from 'src/domain/repositories/access.repository';
|
|
|
|
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']>;
|
|
partner: jest.Mocked<IAccessRepository['partner']>;
|
|
}
|
|
|
|
export const newAccessRepositoryMock = (reset = true): IAccessRepositoryMock => {
|
|
if (reset) {
|
|
AccessCore.reset();
|
|
}
|
|
|
|
return {
|
|
activity: {
|
|
checkOwnerAccess: jest.fn().mockResolvedValue(new Set()),
|
|
checkAlbumOwnerAccess: jest.fn().mockResolvedValue(new Set()),
|
|
checkCreateAccess: jest.fn().mockResolvedValue(new Set()),
|
|
},
|
|
|
|
asset: {
|
|
checkOwnerAccess: jest.fn().mockResolvedValue(new Set()),
|
|
checkAlbumAccess: jest.fn().mockResolvedValue(new Set()),
|
|
checkPartnerAccess: jest.fn().mockResolvedValue(new Set()),
|
|
checkSharedLinkAccess: jest.fn().mockResolvedValue(new Set()),
|
|
},
|
|
|
|
album: {
|
|
checkOwnerAccess: jest.fn().mockResolvedValue(new Set()),
|
|
checkSharedAlbumAccess: jest.fn().mockResolvedValue(new Set()),
|
|
checkSharedLinkAccess: jest.fn().mockResolvedValue(new Set()),
|
|
},
|
|
|
|
authDevice: {
|
|
checkOwnerAccess: jest.fn().mockResolvedValue(new Set()),
|
|
},
|
|
|
|
library: {
|
|
checkOwnerAccess: jest.fn().mockResolvedValue(new Set()),
|
|
},
|
|
|
|
timeline: {
|
|
checkPartnerAccess: jest.fn().mockResolvedValue(new Set()),
|
|
},
|
|
|
|
person: {
|
|
checkFaceOwnerAccess: jest.fn().mockResolvedValue(new Set()),
|
|
checkOwnerAccess: jest.fn().mockResolvedValue(new Set()),
|
|
},
|
|
|
|
partner: {
|
|
checkUpdateAccess: jest.fn().mockResolvedValue(new Set()),
|
|
},
|
|
};
|
|
};
|