mirror of
https://github.com/immich-app/immich.git
synced 2026-03-04 09:57:33 +03:00
refactor: migrate library repository to kysely (#15271)
This commit is contained in:
@@ -87,7 +87,7 @@ describe(LibraryService.name, () => {
|
||||
Promise.resolve(
|
||||
[libraryStub.externalLibraryWithImportPaths1, libraryStub.externalLibraryWithImportPaths2].find(
|
||||
(library) => library.id === id,
|
||||
) || null,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -190,8 +190,6 @@ describe(LibraryService.name, () => {
|
||||
});
|
||||
|
||||
it("should fail when library can't be found", async () => {
|
||||
libraryMock.get.mockResolvedValue(null);
|
||||
|
||||
await expect(sut.handleQueueSyncFiles({ id: libraryStub.externalLibrary1.id })).resolves.toBe(JobStatus.SKIPPED);
|
||||
});
|
||||
|
||||
@@ -242,8 +240,6 @@ describe(LibraryService.name, () => {
|
||||
});
|
||||
|
||||
it("should fail when library can't be found", async () => {
|
||||
libraryMock.get.mockResolvedValue(null);
|
||||
|
||||
await expect(sut.handleQueueSyncAssets({ id: libraryStub.externalLibrary1.id })).resolves.toBe(JobStatus.SKIPPED);
|
||||
});
|
||||
});
|
||||
@@ -630,7 +626,6 @@ describe(LibraryService.name, () => {
|
||||
});
|
||||
|
||||
it('should throw an error when a library is not found', async () => {
|
||||
libraryMock.get.mockResolvedValue(null);
|
||||
await expect(sut.get(libraryStub.externalLibrary1.id)).rejects.toBeInstanceOf(BadRequestException);
|
||||
expect(libraryMock.get).toHaveBeenCalledWith(libraryStub.externalLibrary1.id);
|
||||
});
|
||||
@@ -825,7 +820,10 @@ describe(LibraryService.name, () => {
|
||||
await expect(sut.update('library-id', { importPaths: [`${cwd}/foo/bar`] })).resolves.toEqual(
|
||||
mapLibrary(libraryStub.externalLibrary1),
|
||||
);
|
||||
expect(libraryMock.update).toHaveBeenCalledWith(expect.objectContaining({ id: 'library-id' }));
|
||||
expect(libraryMock.update).toHaveBeenCalledWith(
|
||||
'library-id',
|
||||
expect.objectContaining({ importPaths: [`${cwd}/foo/bar`] }),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1015,7 +1013,7 @@ describe(LibraryService.name, () => {
|
||||
Promise.resolve(
|
||||
[libraryStub.externalLibraryWithImportPaths1, libraryStub.externalLibraryWithImportPaths2].find(
|
||||
(library) => library.id === id,
|
||||
) || null,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user