diff --git a/apps/api/src/public/public.service.spec.ts b/apps/api/src/public/public.service.spec.ts index 535d528..c3ce81d 100644 --- a/apps/api/src/public/public.service.spec.ts +++ b/apps/api/src/public/public.service.spec.ts @@ -387,6 +387,14 @@ describe('PublicService', () => { ); }); + it('home-goods dedupes by family (keeps the best-positioned good)', async () => { + const home = await service.getHomeGoods({ limit: 50 }); + // fixture 族的两条带位商品(High index=1 / Mid index=5)→ 只出一条代表行 + const ours = home.filter((h) => h.goodId === familyId.toString()); + expect(ours).toHaveLength(1); + expect(ours[0].goodName).toBe(`Pub High ${stamp}`); + }); + it('getTags returns tags with their group info, sorted by group then order', async () => { const tags = await service.getTags(); expect(tags.length).toBeGreaterThan(0);