test(FN-4599): complete Step 5 — lock category and exempt panel coverage
Fusion-Task-Id: FN-4599 Fusion-Task-Lineage: 39bdbfd4-d90a-4232-a447-23ef107732e4
This commit is contained in:
@@ -132,7 +132,7 @@ export function AgentPermissionPolicyEditor({ value, projectDefault, mode, onCha
|
||||
const effective = rules[category] ?? "allow";
|
||||
const rowValue = mode === "agent-override" && !value ? "inherit" : effective;
|
||||
return (
|
||||
<div key={category} className="agent-policy-row" role="row">
|
||||
<div key={category} className="agent-policy-row" role="row" data-category={category}>
|
||||
<div className="agent-policy-cell">
|
||||
<strong>{meta.label}</strong>
|
||||
<div className="agent-policy-description">{meta.description}</div>
|
||||
|
||||
@@ -130,17 +130,12 @@ describe("AgentPermissionPolicyEditor", () => {
|
||||
/>,
|
||||
);
|
||||
|
||||
const labels = Array.from(container.querySelectorAll(".agent-policy-row .agent-policy-cell strong"))
|
||||
.map((node) => node.textContent ?? "");
|
||||
const rowCategories = Array.from(container.querySelectorAll(".agent-policy-row"))
|
||||
.map((row) => row.getAttribute("data-category"))
|
||||
.filter((value): value is string => typeof value === "string");
|
||||
|
||||
expect(labels).toEqual([
|
||||
"Git writes",
|
||||
"File writes/deletes",
|
||||
"Command execution",
|
||||
"Network/API",
|
||||
"Task/agent mutation",
|
||||
]);
|
||||
expect(labels).toHaveLength(AGENT_PERMISSION_POLICY_ACTION_CATEGORIES.length);
|
||||
expect(new Set(rowCategories)).toEqual(new Set(AGENT_PERMISSION_POLICY_ACTION_CATEGORIES));
|
||||
expect(rowCategories).toHaveLength(AGENT_PERMISSION_POLICY_ACTION_CATEGORIES.length);
|
||||
});
|
||||
|
||||
it("keeps exempt tools panel read-only", () => {
|
||||
|
||||
Reference in New Issue
Block a user