2024-03-21 12:59:49 +01:00
|
|
|
import { IAssetRepository } from 'src/interfaces/asset.interface';
|
2024-04-16 10:44:45 -04:00
|
|
|
import { Mocked, vitest } from 'vitest';
|
2023-02-25 09:12:03 -05:00
|
|
|
|
2024-04-16 10:44:45 -04:00
|
|
|
export const newAssetRepositoryMock = (): Mocked<IAssetRepository> => {
|
2023-02-25 09:12:03 -05:00
|
|
|
return {
|
2024-04-16 10:44:45 -04: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-24 21:02:22 -04:00
|
|
|
getByDeviceIds: vitest.fn(),
|
2024-04-16 10:44:45 -04:00
|
|
|
getByUserId: vitest.fn(),
|
|
|
|
getById: vitest.fn(),
|
|
|
|
getWithout: vitest.fn(),
|
|
|
|
getByChecksum: vitest.fn(),
|
2024-05-24 21:02:22 -04:00
|
|
|
getByChecksums: vitest.fn(),
|
2024-05-02 15:42:26 -04:00
|
|
|
getUploadAssetIdByChecksum: vitest.fn(),
|
2024-04-16 10:44:45 -04:00
|
|
|
getRandom: vitest.fn(),
|
|
|
|
getLastUpdatedAssetForAlbumId: vitest.fn(),
|
|
|
|
getAll: vitest.fn().mockResolvedValue({ items: [], hasNextPage: false }),
|
|
|
|
getAllByDeviceId: vitest.fn(),
|
2024-06-27 15:41:49 -04:00
|
|
|
getLivePhotoCount: vitest.fn(),
|
2024-04-16 10:44:45 -04:00
|
|
|
updateAll: vitest.fn(),
|
2024-05-16 13:08:37 -04:00
|
|
|
updateDuplicates: vitest.fn(),
|
2024-04-16 10:44:45 -04: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 13:08:37 -04:00
|
|
|
getDuplicates: vitest.fn(),
|
2024-08-19 20:03:33 -04:00
|
|
|
upsertFile: vitest.fn(),
|
2024-09-28 13:47:24 -04:00
|
|
|
upsertFiles: vitest.fn(),
|
2023-02-25 09:12:03 -05:00
|
|
|
};
|
|
|
|
};
|