27 lines
754 B
TypeScript
27 lines
754 B
TypeScript
import assert from "node:assert/strict";
|
|
import { describe, it } from "node:test";
|
|
|
|
import type { ActionPlan } from "@/types/appops";
|
|
import { buildCommandPreflightRequest } from "./commandPreflight.ts";
|
|
|
|
const plan: ActionPlan = {
|
|
intent: "container.restart",
|
|
target: "widefrog",
|
|
source: "manual",
|
|
risk: "medium",
|
|
policy: "allowed",
|
|
reason: "Operator requested restart.",
|
|
plan: ["Check health", "Restart container"],
|
|
postChecks: ["Container healthy"],
|
|
};
|
|
|
|
describe("buildCommandPreflightRequest", () => {
|
|
it("uses the current command plan as the preflight source", () => {
|
|
assert.deepEqual(buildCommandPreflightRequest(plan), {
|
|
action: "container.restart",
|
|
target: "widefrog",
|
|
source: "manual",
|
|
});
|
|
});
|
|
});
|