fix: resolve remaining typescript errors
This commit is contained in:
1 parent
f4c06cbc95
commit
0576d946c5
3 files changed
+19
-16
No files matched your search
@@ -222,7 +222,7 @@ test("0002 preserves dirty rows and reconstructs only provable legacy intents",
|
||||
status: "authorized",
|
||||
authorizedAt,
|
||||
});
|
||||
expect(immich.listAlbumsForAsset).not.toHaveBeenCalled();
|
||||
expect(immich.getAlbum).not.toHaveBeenCalled();
|
||||
expect(immich.getAsset).not.toHaveBeenCalled();
|
||||
|
||||
const migratedEvents = await testDb.pool.query<{
|
||||
|
||||
@@ -219,17 +219,21 @@ test("requires an active grant for the exact requested album", async () => {
|
||||
test("rechecks exact album membership after database locks before inserting", async () => {
|
||||
const editorialId = await seedEditorial();
|
||||
const { usageService, immich } = createServices();
|
||||
immich.listAlbumsForAsset
|
||||
.mockResolvedValueOnce([
|
||||
{
|
||||
id: albumId,
|
||||
albumName: "Presse 2026",
|
||||
description: null,
|
||||
albumThumbnailAssetId: assetId,
|
||||
assetCount: 1,
|
||||
},
|
||||
])
|
||||
.mockResolvedValueOnce([]);
|
||||
immich.getAsset
|
||||
.mockResolvedValueOnce({
|
||||
id: assetId,
|
||||
type: "IMAGE" as const,
|
||||
originalFileName: "jubel.jpg",
|
||||
originalMimeType: "image/jpeg",
|
||||
albums: [{ id: albumId }],
|
||||
})
|
||||
.mockResolvedValueOnce({
|
||||
id: assetId,
|
||||
type: "IMAGE" as const,
|
||||
originalFileName: "jubel.jpg",
|
||||
originalMimeType: "image/jpeg",
|
||||
albums: [],
|
||||
});
|
||||
|
||||
await expect(usageService.createNewUsage(newInput(editorialId))).rejects.toMatchObject({
|
||||
code: "ASSET_NOT_IN_ALBUM",
|
||||
@@ -238,7 +242,7 @@ test("rechecks exact album membership after database locks before inserting", as
|
||||
.select({ value: count() })
|
||||
.from(usages)
|
||||
.where(eq(usages.editorialAccountId, editorialId));
|
||||
expect(immich.listAlbumsForAsset).toHaveBeenCalledTimes(2);
|
||||
expect(immich.getAlbum).toHaveBeenCalledTimes(2);
|
||||
expect(usageCount.value).toBe(0);
|
||||
});
|
||||
|
||||
@@ -292,7 +296,7 @@ test("returns a winner committed while waiting before later mutable state is che
|
||||
authorizedAt: winner.authorizedAt,
|
||||
billable: true,
|
||||
});
|
||||
expect(immich.listAlbumsForAsset).toHaveBeenCalledTimes(1);
|
||||
expect(immich.getAlbum).toHaveBeenCalledTimes(1);
|
||||
expect(immich.getAsset).toHaveBeenCalledTimes(1);
|
||||
} finally {
|
||||
await locker.query("rollback");
|
||||
@@ -334,7 +338,7 @@ test("reports a conflicting winner committed while waiting before later state er
|
||||
await locker.query("commit");
|
||||
|
||||
await expect(pending).rejects.toMatchObject({ code: "IDEMPOTENCY_CONFLICT" });
|
||||
expect(immich.listAlbumsForAsset).toHaveBeenCalledTimes(1);
|
||||
expect(immich.getAlbum).toHaveBeenCalledTimes(1);
|
||||
expect(immich.getAsset).toHaveBeenCalledTimes(1);
|
||||
} finally {
|
||||
await locker.query("rollback");
|
||||
|
||||
Reference in new issue
Block a user