fix: harden editorial thumbnail authorization
This commit is contained in:
1 parent
66f0599653
commit
846904f3db
11 files changed
+182
-36
No files matched your search
@@ -104,6 +104,22 @@ test("normalizes descriptions and bounds invalid pagination before sending an up
|
||||
);
|
||||
});
|
||||
|
||||
test("passes a bounded decimal page string from the SSR query through to Immich", async () => {
|
||||
const { catalog, immich } = createCatalog();
|
||||
|
||||
await catalog.searchVisiblePhotos("editorial-1", { page: "2" });
|
||||
expect(immich.searchPhotos).toHaveBeenLastCalledWith(expect.objectContaining({ page: 2 }));
|
||||
|
||||
await catalog.searchVisiblePhotos("editorial-1", { page: "not-a-page" });
|
||||
expect(immich.searchPhotos).toHaveBeenLastCalledWith(expect.objectContaining({ page: 1 }));
|
||||
|
||||
await catalog.searchVisiblePhotos("editorial-1", { page: "-2" });
|
||||
expect(immich.searchPhotos).toHaveBeenLastCalledWith(expect.objectContaining({ page: 1 }));
|
||||
|
||||
await catalog.searchVisiblePhotos("editorial-1", { page: "100000" });
|
||||
expect(immich.searchPhotos).toHaveBeenLastCalledWith(expect.objectContaining({ page: 1_000 }));
|
||||
});
|
||||
|
||||
test("only returns the current editorial's albums from the Immich album list", async () => {
|
||||
const { catalog } = createCatalog({ grantedAlbumIds: ["allowed"] });
|
||||
|
||||
|
||||
Reference in new issue
Block a user