diff --git a/src/test/app/(protected)/uplifts/uplift-detail-modal-permissions.test.tsx b/src/test/app/(protected)/uplifts/uplift-detail-modal-permissions.test.tsx index 533f3151..a2ab1b9c 100644 --- a/src/test/app/(protected)/uplifts/uplift-detail-modal-permissions.test.tsx +++ b/src/test/app/(protected)/uplifts/uplift-detail-modal-permissions.test.tsx @@ -128,10 +128,19 @@ describe("UpliftDetailModal permission failures (Dispatcher 403)", () => { expect(within(workOrder).getByText("Gateway Plumbing · Tom Tech")).toBeInTheDocument(); expect(within(workOrder).getByText("Apr 10, 2026")).toBeInTheDocument(); expect(within(workOrder).queryByText("Unavailable")).not.toBeInTheDocument(); + expect(toastMocks.error).not.toHaveBeenCalled(); + }); - await waitFor(() => { - expect(screen.getAllByText("Unavailable").length).toBeGreaterThanOrEqual(3); - }); + it("marks the approved-on-WO breakdown unavailable without a toast and keeps Revoke admin-only", async () => { + renderWithGovernedClient(); + + const request = screen.getByRole("region", { name: "Uplift request" }); + for (const label of ["Auto-approved (within allowance)", "Admin-approved", "Total"]) { + const row = within(request).getByText(label).parentElement as HTMLElement; + await waitFor(() => { + expect(within(row).getByText("Unavailable")).toBeInTheDocument(); + }); + } const revoke = screen.getByRole("button", { name: "Revoke" }); expect(revoke).toBeDisabled(); 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 ef1b683b..4c999d2b 100644 --- a/src/test/app/(protected)/uplifts/uplift-detail-modal.test.tsx +++ b/src/test/app/(protected)/uplifts/uplift-detail-modal.test.tsx @@ -135,7 +135,15 @@ describe("UpliftDetailModal", () => { const request = section("Uplift request"); expect(fieldValue(request, "Requested By")).toBe("Gateway"); - expect(fieldValue(request, "Requested At")).toMatch(/^Jan 15, 2026 · \d{1,2}:\d{2} [AP]M$/u); + // The instant renders in the viewer's zone, so the calendar day is derived, not fixed. + const localDay = new Date(baseItem.requestedAt).toLocaleDateString("en-US", { + month: "short", + day: "numeric", + year: "numeric", + }); + expect(fieldValue(request, "Requested At")).toMatch( + new RegExp(`^${localDay} · \\d{1,2}:\\d{2} [AP]M$`, "u"), + ); expect(screen.getByTestId("uplift-justification")).toHaveTextContent( "Scope grew after inspection", );