test(public): cover home-goods family dedupe
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user