mirror of
				https://github.com/immich-app/immich.git
				synced 2025-10-31 18:58:56 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			44 lines
		
	
	
		
			1008 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			44 lines
		
	
	
		
			1008 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { AccessCore, IAccessRepository } from '@app/domain';
 | |
| 
 | |
| export interface IAccessRepositoryMock {
 | |
|   asset: jest.Mocked<IAccessRepository['asset']>;
 | |
|   album: jest.Mocked<IAccessRepository['album']>;
 | |
|   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 {
 | |
|     asset: {
 | |
|       hasOwnerAccess: jest.fn(),
 | |
|       hasAlbumAccess: jest.fn(),
 | |
|       hasPartnerAccess: jest.fn(),
 | |
|       hasSharedLinkAccess: jest.fn(),
 | |
|     },
 | |
| 
 | |
|     album: {
 | |
|       hasOwnerAccess: jest.fn(),
 | |
|       hasSharedAlbumAccess: jest.fn(),
 | |
|       hasSharedLinkAccess: jest.fn(),
 | |
|     },
 | |
| 
 | |
|     library: {
 | |
|       hasOwnerAccess: jest.fn(),
 | |
|       hasPartnerAccess: jest.fn(),
 | |
|     },
 | |
| 
 | |
|     timeline: {
 | |
|       hasPartnerAccess: jest.fn(),
 | |
|     },
 | |
| 
 | |
|     person: {
 | |
|       hasOwnerAccess: jest.fn(),
 | |
|     },
 | |
|   };
 | |
| };
 |