mirror of
https://github.com/immich-app/immich.git
synced 2026-03-22 15:49:24 +03:00
fix: implement existing withStacked on searchAssetBuilder (#26607)
Co-authored-by: Joe <code@joebabbitt.com>
This commit is contained in:
@@ -88,4 +88,24 @@ describe(SearchService.name, () => {
|
||||
expect(result).toEqual({ total: 0 });
|
||||
});
|
||||
});
|
||||
|
||||
describe('withStacked option', () => {
|
||||
it('should exclude stacked assets when withStacked is false', async () => {
|
||||
const { sut, ctx } = setup();
|
||||
const { user } = await ctx.newUser();
|
||||
|
||||
const { asset: primaryAsset } = await ctx.newAsset({ ownerId: user.id });
|
||||
const { asset: stackedAsset } = await ctx.newAsset({ ownerId: user.id });
|
||||
const { asset: unstackedAsset } = await ctx.newAsset({ ownerId: user.id });
|
||||
|
||||
await ctx.newStack({ ownerId: user.id }, [primaryAsset.id, stackedAsset.id]);
|
||||
|
||||
const auth = factory.auth({ user: { id: user.id } });
|
||||
|
||||
const response = await sut.searchMetadata(auth, { withStacked: false });
|
||||
|
||||
expect(response.assets.items.length).toBe(1);
|
||||
expect(response.assets.items[0].id).toBe(unstackedAsset.id);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user