diff --git a/src/components/ai-fill-marker.test.tsx b/src/components/ai-fill-marker.test.tsx index 130a806..e232a91 100644 --- a/src/components/ai-fill-marker.test.tsx +++ b/src/components/ai-fill-marker.test.tsx @@ -68,6 +68,9 @@ describe("AiFillMarker", () => { expect(screen.getByText("Same size and finish")).toBeInTheDocument(); expect(screen.getByText("Length not stated")).toBeInTheDocument(); expect(screen.getByText("Could be stainless")).toBeInTheDocument(); + // Doubts are highlighted in the warning colour. + expect(screen.getByText("Doubts").className).toContain("text-warn"); + expect(screen.getByText("Length not stated").closest("ul")?.className).toContain("text-warn"); expect(screen.queryByText("Selling price from default markup")).not.toBeInTheDocument(); }); @@ -91,7 +94,7 @@ describe("AiFillMarker", () => { item={{ id: "i1", ai_fill: fill({ status, stock_item_id: null }), pricing_source: "" }} />, ); - expect(screen.getByText("AI: no match")).toBeInTheDocument(); + expect(screen.getByRole("button", { name: "AI: no match" })).toBeInTheDocument(); }); it("lists candidates in the no_match popover", async () => { @@ -112,7 +115,7 @@ describe("AiFillMarker", () => { }} />, ); - fireEvent.click(screen.getByText("AI: no match")); + fireEvent.click(screen.getByRole("button", { name: "AI: no match" })); expect(await screen.findByText("None were the right size")).toBeInTheDocument(); expect(screen.getByText("M12 Bolt")).toBeInTheDocument(); expect(screen.getByText("M8 Bolt")).toBeInTheDocument(); diff --git a/src/components/ai-fill-marker.tsx b/src/components/ai-fill-marker.tsx index 6916b9e..0a2b76c 100644 --- a/src/components/ai-fill-marker.tsx +++ b/src/components/ai-fill-marker.tsx @@ -3,7 +3,7 @@ import Link from "next/link"; import { Bot } from "lucide-react"; -import { Badge } from "@/components/ui/badge"; +import { Badge, badgeVariants } from "@/components/ui/badge"; import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; import { isAiFillPending } from "@/lib/quote-assistant-review"; import type { QuoteItem, QuoteItemAiFill } from "@/lib/types"; @@ -65,9 +65,9 @@ function FilledNotes({ fill }: { fill: QuoteItemAiFill }) { {fill.reason ?

{fill.reason}

: null} {fill.doubts.length > 0 ? ( -
- Doubts -