diff --git a/src/Components/Artwork/Details/Details.tsx b/src/Components/Artwork/Details/Details.tsx index f20aa5562ed..3707269f4bb 100644 --- a/src/Components/Artwork/Details/Details.tsx +++ b/src/Components/Artwork/Details/Details.tsx @@ -253,24 +253,17 @@ const BidInfo: React.FC = ({ return null } - const bidderPositionCounts = sale_artwork?.counts?.bidder_positions ?? 0 - const bidCount = collectorSignals?.auction?.bidCount ?? 0 + const bidCount = signalsAuctionEnabled + ? collectorSignals?.auction?.bidCount ?? 0 + : sale_artwork?.counts?.bidder_positions ?? 0 - if (bidCount === 0 && bidderPositionCounts === 0) { + if (bidCount === 0) { return null } return ( <> - {signalsAuctionEnabled ? ( - <> - ({bidCount} bid{bidCount === 1 ? "" : "s"}) - - ) : ( - <> - ({bidderPositionCounts} bid{bidderPositionCounts === 1 ? "" : "s"}) - - )} + ({bidCount} bid{bidCount === 1 ? "" : "s"}) ) } diff --git a/src/Components/Artwork/Details/__tests__/Details.jest.tsx b/src/Components/Artwork/Details/__tests__/Details.jest.tsx index 20aad9ee817..5a8fe18c016 100644 --- a/src/Components/Artwork/Details/__tests__/Details.jest.tsx +++ b/src/Components/Artwork/Details/__tests__/Details.jest.tsx @@ -636,6 +636,28 @@ describe("Details", () => { expect(html).toContain("Increased Interest") }) + + it("does not show the number of bids when there are bids on the sale artwork but no auction signals", async () => { + const data: any = { + ...artworkInAuction, + collectorSignals: { + ...artworkInAuction?.collectorSignals, + auction: null, + }, + sale_artwork: { + ...artworkInAuction?.sale_artwork, + counts: { + ...artworkInAuction?.sale_artwork?.counts, + bidder_positions: 2, + }, + }, + } + + const wrapper = await getWrapper(data) + const html = wrapper.html() + expect(html).toContain("$2,600") + expect(html).not.toMatch(/\d+ bids?/) + }) }) })