Initial curated Unraid-AppOps-Gateway source from 3bd6f6fee310125bfbb4d4650389a817f498724d
This commit is contained in:
commit
1dfbca08a1
528 files changed
+131054
No files matched your search
@@ -0,0 +1,44 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { describe, it } from "node:test";
|
||||
|
||||
import { buildSafetyPlanFeedback, buildSafetyStateFeedback } from "./safetyActionFeedback.ts";
|
||||
|
||||
describe("safetyActionFeedback", () => {
|
||||
it("describes finding state changes as metadata-only", () => {
|
||||
const feedback = buildSafetyStateFeedback("finding", "finding-1", "acknowledged");
|
||||
|
||||
assert.equal(feedback.tone, "success");
|
||||
assert.match(feedback.description, /metadata-only/);
|
||||
assert.deepEqual(feedback.links[0], { label: "Open audit", href: "/audit?query=finding-1" });
|
||||
});
|
||||
|
||||
it("links successful remediation plan creation to the non-executing plan", () => {
|
||||
const feedback = buildSafetyPlanFeedback("rec-1", {
|
||||
success: true,
|
||||
status: "plan_linked",
|
||||
href: "/ai/remediation-planner?plan=plan-1",
|
||||
executable: false,
|
||||
planId: "plan-1",
|
||||
});
|
||||
|
||||
assert.equal(feedback.tone, "success");
|
||||
assert.match(feedback.description, /niet-uitvoerend/);
|
||||
assert.deepEqual(feedback.links, [
|
||||
{ label: "Open plan", href: "/ai/remediation-planner?plan=plan-1" },
|
||||
{ label: "Open audit", href: "/audit?query=plan-1" },
|
||||
]);
|
||||
});
|
||||
|
||||
it("warns if a future plan result ever reports executable true", () => {
|
||||
const feedback = buildSafetyPlanFeedback("rec-1", {
|
||||
success: true,
|
||||
status: "plan_linked",
|
||||
href: "/ai/remediation-planner?plan=plan-1",
|
||||
executable: true,
|
||||
planId: "plan-1",
|
||||
});
|
||||
|
||||
assert.equal(feedback.tone, "warning");
|
||||
assert.match(feedback.description, /Controleer execution/);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user