From 7bc7208f8a95c9b9513b544b004ba2f1a07ef0c6 Mon Sep 17 00:00:00 2001 From: SJCoetz Date: Wed, 29 Jul 2026 15:09:06 +0200 Subject: [PATCH] chore(item-history): pin Fastener Co duplicate rendering in popover tests Co-authored-by: Orca --- src/components/item-history-popover.test.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/item-history-popover.test.tsx b/src/components/item-history-popover.test.tsx index dc77679..224cfd7 100644 --- a/src/components/item-history-popover.test.tsx +++ b/src/components/item-history-popover.test.tsx @@ -49,8 +49,10 @@ describe("ItemHistoryPopover", () => { ); expect(screen.getByText(/PB-derived/)).toBeInTheDocument(); expect(screen.getByText(/AI snapshot/)).toBeInTheDocument(); - expect(screen.getAllByText(/Fastener Co/).length).toBeGreaterThan(0); - expect(screen.getAllByText(/Phone Fastener Co/).length).toBeGreaterThan(0); + // Deterministic card shows "Fastener Co" twice (cheapest + suppliers list). + expect(screen.getAllByText(/Fastener Co/).length).toBeGreaterThanOrEqual(2); + // AI summary mentions Fastener Co (also rendered again in the raw JSON dump). + expect(screen.getAllByText(/Phone Fastener Co/).length).toBeGreaterThanOrEqual(1); }); it("renders only the deterministic card when AI is null", () => {