diff --git a/ui/src/components/actions/ActionCard.test.tsx b/ui/src/components/actions/ActionCard.test.tsx new file mode 100644 index 00000000000..4e6846f45aa --- /dev/null +++ b/ui/src/components/actions/ActionCard.test.tsx @@ -0,0 +1,141 @@ +// @vitest-environment jsdom + +import { act } from "react"; +import { createRoot } from "react-dom/client"; +import type { ReactElement } from "react"; +import { afterEach, describe, expect, it, vi } from "vitest"; +import { ActionCard, ActionCardMobile, BindingsTable, shortSha } from "./ActionCard"; + +// EnforcementBanner pulls in a react-query hook; the stale variant only needs +// its presentational copy, so stub it to keep the test free of a QueryClient. +vi.mock("@/components/EnforcementBanner", () => ({ + EnforcementBanner: ({ title, body }: { title?: string; body?: string }) => ( +
+ {agentName} requested approval to call +
+{toolName}
+Input
+
+ {json}
+
+ Why I'm asking
++ {reason} + {policyNumber != null ? ( + <> + {" "} + Policy #{policyNumber} requires approval here. + > + ) : null} +
+
+ Signed payload sha256 + expiry surface on every variant (PAP-10400). The{" "}
+ stale variant tints the border amber, banners the catalog-hash mismatch, strikes through
+ the previous hash next to the current one, and renders Approve disabled until the request
+ is re-issued.
+
+ Identical content; the three buttons stack full-width in the order Approve / Deny / Edit & re-sign, + and the bindings table uses a 70px label column. +
+
+ Two-column key/value block with mono values. Lives inside ActionCard and is reused
+ standalone in the audit row drilldown.
+