2024-03-21 12:59:49 +01:00
|
|
|
import { IAssetRepository } from 'src/interfaces/asset.interface';
|
2024-04-16 16:44:45 +02:00
|
|
|
import { Mocked, vitest } from 'vitest';
|
2023-02-25 15:12:03 +01:00
|
|
|
|
2024-04-16 16:44:45 +02:00
|
|
|
export const newAssetRepositoryMock = (): Mocked<IAssetRepository> => {
|
2023-02-25 15:12:03 +01:00
|
|
|
return {
|
2024-04-16 16:44:45 +02:00
|
|
|
create: vitest.fn(),
|
|
|
|
upsertExif: vitest.fn(),
|
|
|
|
upsertJobStatus: vitest.fn(),
|
|
|
|
getByDayOfYear: vitest.fn(),
|
|
|
|
getByIds: vitest.fn().mockResolvedValue([]),
|
|
|
|
getByIdsWithAllRelations: vitest.fn().mockResolvedValue([]),
|
|
|
|
getByAlbumId: vitest.fn(),
|
2024-05-25 03:02:22 +02:00
|
|
|
getByDeviceIds: vitest.fn(),
|
2024-04-16 16:44:45 +02:00
|
|
|
getByUserId: vitest.fn(),
|
|
|
|
getById: vitest.fn(),
|
|
|
|
getWithout: vitest.fn(),
|
|
|
|
getByChecksum: vitest.fn(),
|
2024-05-25 03:02:22 +02:00
|
|
|
getByChecksums: vitest.fn(),
|
2024-05-02 21:42:26 +02:00
|
|
|
getUploadAssetIdByChecksum: vitest.fn(),
|
2024-04-16 16:44:45 +02:00
|
|
|
getRandom: vitest.fn(),
|
|
|
|
getLastUpdatedAssetForAlbumId: vitest.fn(),
|
|
|
|
getAll: vitest.fn().mockResolvedValue({ items: [], hasNextPage: false }),
|
|
|
|
getAllByDeviceId: vitest.fn(),
|
2024-06-27 21:41:49 +02:00
|
|
|
getLivePhotoCount: vitest.fn(),
|
2024-04-16 16:44:45 +02:00
|
|
|
updateAll: vitest.fn(),
|
2024-05-16 19:08:37 +02:00
|
|
|
updateDuplicates: vitest.fn(),
|
2024-04-16 16:44:45 +02:00
|
|
|
getByLibraryIdAndOriginalPath: vitest.fn(),
|
|
|
|
deleteAll: vitest.fn(),
|
|
|
|
update: vitest.fn(),
|
|
|
|
remove: vitest.fn(),
|
|
|
|
findLivePhotoMatch: vitest.fn(),
|
|
|
|
getStatistics: vitest.fn(),
|
|
|
|
getTimeBucket: vitest.fn(),
|
|
|
|
getTimeBuckets: vitest.fn(),
|
|
|
|
getAssetIdByCity: vitest.fn(),
|
|
|
|
getAllForUserFullSync: vitest.fn(),
|
|
|
|
getChangedDeltaSync: vitest.fn(),
|
2024-05-16 19:08:37 +02:00
|
|
|
getDuplicates: vitest.fn(),
|
2024-08-20 02:03:33 +02:00
|
|
|
upsertFile: vitest.fn(),
|
2024-09-28 19:47:24 +02:00
|
|
|
upsertFiles: vitest.fn(),
|
2023-02-25 15:12:03 +01:00
|
|
|
};
|
|
|
|
};
|