From 6a2b9eb80c47cbdc82326049022bb8dcba96749a Mon Sep 17 00:00:00 2001 From: Codex Review Integration Date: Wed, 16 Sep 2026 22:50:40 -0300 Subject: [PATCH] test(uplifts): cover detail evidence callback (SH-209) --- .../uplifts/uplift-detail-modal.test.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/test/app/(protected)/uplifts/uplift-detail-modal.test.tsx b/src/test/app/(protected)/uplifts/uplift-detail-modal.test.tsx index fda63056..60654846 100644 --- a/src/test/app/(protected)/uplifts/uplift-detail-modal.test.tsx +++ b/src/test/app/(protected)/uplifts/uplift-detail-modal.test.tsx @@ -55,6 +55,7 @@ function renderModal(overrides: Partial = {}) { const onApprove = vi.fn(); const onReject = vi.fn(); const onRevoke = vi.fn(); + const onOpenAttachment = vi.fn(); renderWithProviders( = {}) { onApprove={onApprove} onReject={onReject} onRevoke={onRevoke} + onOpenAttachment={onOpenAttachment} />, ); - return { onApprove, onReject, onRevoke }; + return { onApprove, onReject, onRevoke, onOpenAttachment }; } describe("UpliftDetailModal", () => { @@ -88,6 +90,19 @@ describe("UpliftDetailModal", () => { expect(screen.getByText("No attachments")).toBeInTheDocument(); }); + it("opens an evidence attachment through the provided callback", () => { + const { onOpenAttachment } = renderModal({ + evidenceDocumentId: "document-1", + evidenceFileName: "quote.pdf", + attachmentCount: 1, + }); + + fireEvent.click(screen.getByText("quote.pdf")); + expect(onOpenAttachment).toHaveBeenCalledWith( + expect.objectContaining({ evidenceDocumentId: "document-1" }), + ); + }); + it("falls back to the work order uplifts for the approved-on-WO breakdown", () => { renderModal();