Files
openclaw/src/gateway/system-run-approval-binding.test.ts
Josh Lehman adc329b26b test: dedupe extension-owned coverage (#58554)
* test: dedupe extension-owned coverage

* test: remove duplicate coverage files

* test: move helper coverage into extensions

* test: trim duplicate helper assertions

* test: remove cloudflare helper import from agent test

* test: align stale expectations with current main
2026-03-31 15:18:29 -07:00

32 lines
955 B
TypeScript

import { describe, expect, test } from "vitest";
import { toSystemRunApprovalMismatchError } from "../infra/system-run-approval-binding.js";
describe("toSystemRunApprovalMismatchError", () => {
test("includes runId/code and preserves mismatch details", () => {
const result = toSystemRunApprovalMismatchError({
runId: "approval-123",
match: {
ok: false,
code: "APPROVAL_ENV_MISMATCH",
message: "approval id env binding mismatch",
details: {
envKeys: ["SAFE_A"],
expectedEnvHash: "expected-hash",
actualEnvHash: "actual-hash",
},
},
});
expect(result).toEqual({
ok: false,
message: "approval id env binding mismatch",
details: {
code: "APPROVAL_ENV_MISMATCH",
runId: "approval-123",
envKeys: ["SAFE_A"],
expectedEnvHash: "expected-hash",
actualEnvHash: "actual-hash",
},
});
});
});